/**
 * 将omap中可以转为js类型的属性都转换
 * @param {Object} omap
 * @returns {Object}
 */
export function formatJsonPropertyToMap (omap) {
  const map = { ...omap }
  const keys = Object.keys(map)
  keys.forEach(item => {
    try {
      map[item] = JSON.parse(map[item])
    } catch (error) {
    }
  })
  return map
}
/**
 * 将omap中的非原始类型转为json字符串
 * @param {Object} omap
 * @returns {Object}
 */
export function formatMapPropertyToJson (omap) {
  const map = { ...omap }
  const keys = Object.keys(map)
  keys.forEach(item => {
    if (typeof map[item] === 'object') {
      map[item] = JSON.stringify(map[item])
    }
  })
  return map
}
