docs: function CachedFunction (valueGetter, {strictArgMatch = true, ttl} = {}) {
    check.assert(typeof this === 'undefined', 'Do not call CachedFunction with `new`. Call it directly.', SyntaxError)
  
    // If we have already created a `CachedFunction` for this `valueGetter` and
    // set of arguments, return it.
    const paramsKey = maybeStringify(arguments[1], {fallback: ''})
    if (cachedFunctions.has(valueGetter) && cachedFunctions.get(valueGetter).has(paramsKey)) {
      return cachedFunctions.get(valueGetter).get(paramsKey)
    }
  
    check.assert.function(valueGetter, 'valueGetter must be a function', TypeError)
    check.assert.maybe.integer(ttl, 'ttl must be a positive integer', TypeError)
    check.assert.maybe.positive(ttl, 'ttl must be a positive integer', RangeError)
  
    // Give the cached function the same name as the original function.
    const functionName = valueGetter.name.replace(getRegex, '') || ''
    const cachedFunction = NamedFunction(functionName, function CacheLayer () {
      // Each `this` context needs a separate set of cached values.
      const context = this === global ? noThis : this
      if (!cachedValues.get(cachedFunction).has(context)) {
        const map = new TTLMap()
        map._values = new MultiKeyMap()
        map._ttls = new MultiKeyMap()
        cachedValues.get(cachedFunction).set(context, map)
      }
      const valuesForThis = cachedValues.get(cachedFunction).get(context)
  
      // Based on the function arguments, see if we already have a return value
      // in the cache.
      const key = generateKey(arguments, strictArgMatch)
      if (valuesForThis.has(key)) {
        return valuesForThis.get(key)
      }
  
      // Generate a fresh return value, cache it, and return it.
      const value = valueGetter.apply(this, arguments)
      valuesForThis.set(key, value, ttl)
      return value
    })
  
    cachedValues.set(cachedFunction, new WeakMap())
    cachedFunctionOptions.set(cachedFunction, arguments[1] || {})
  
    // Save this `CachedFunction` for later. If we are given the same `valueGetter`
    // and same arguments, we can return it without having to make a new one.
    if (!cachedFunctions.has(valueGetter)) cachedFunctions.set(valueGetter, new Map())
    cachedFunctions.get(valueGetter).set(paramsKey, cachedFunction)
  
    return cachedFunction
  }