code: function resolveSchemaRefs(data, lookup) {
    if (!data || dataCache.has(data)) return data
  
    if (Array.isArray(data)) {
      return data.map(item => resolveSchemaRefs(item, lookup))
    } else if (typeof data === 'object') {
      if (data.$ref) {
        const resolved = resolveSchemaRef(data.$ref, lookup)
        delete data.$ref
        data = Object.assign({}, resolved, data)
      }
      dataCache.add(data)
  
      for (let name in data) {
        data[name] = resolveSchemaRefs(data[name], lookup)
      }
    }
    return data
  }
docs: Recursively resolves references in the form `#/path/to/object`.
  
  @param {object} data the object to search for and update refs
  @param {object} lookup the object to clone refs from
  @returns {*} the resolved data object