code: function applyReplacer (value, replacer) {
    if (typeof replacer === 'function') {
      const input = {
        '': value
      }
      return applyFunctionReplacer(input, replacer)['']
    }
  
    if (
      isArray(replacer)
      // Array replacer only works for plain object
      && isPlainObject(value)
    ) {
      return applyFunctionReplacer(value, (k, v) => ~ replacer.indexOf(k)
        ? v
        : undefined)
    }
  
    return value
  }
docs: /* eslint-disable no-use-before-define