if (Number.isNaN(a)) {
    a = null
  } else if (typeof a === 'function') {
    a = undefined
  } else if (a && typeof a === 'object') {