export function deepProcess(obj, detailWork) {
  if (obj === null || obj === undefined) {
    return
  }

  if (Array.isArray(obj)) {
    for (let index = 0; index < obj.length; index++) {
      const element = obj[index]
      if (typeof element === 'string') {
        obj[index] = detailWork(element)
      } else if (typeof element === 'object') {
        deepProcess(element, detailWork)
      }
    }
  } else if (typeof obj === 'object') {
    for (const key in obj) {
      if (Object.hasOwnProperty.call(obj, key)) {
        if (typeof obj[key] === 'string') {
          obj[key] = detailWork(obj[key])
        } else if (typeof obj[key] === 'object') {
          deepProcess(obj[key], detailWork)
        }
      }
    }
  }
}