wrapOAS31Fn = (fn, system) => {
  const { fn: systemFn, specSelectors } = system

  return Object.fromEntries(
    Object.entries(fn).map(([name, newImpl]) => {
      const oriImpl = systemFn[name]
      const impl = (...args) =>
        specSelectors.isOAS31()
          ? newImpl(...args)
          : typeof oriImpl === "function"
            ? oriImpl(...args)
            : undefined

      return [name, impl]
    })
  )
}
Runs the fn replacement implementation when spec is OpenAPI 3.1.
Runs the fn original implementation otherwise.

@param fn
@param system
@returns {{[p: string]: function(...[*]): *}}