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