function Cache(opts) {
  let caches = [
    new MemoryStorage()
  ];

  if (opts.fsCachePath) {
    caches.push(new FSStorage({ path: opts.fsCachePath }));
  }

  if (opts.fallback) {
    caches.push(...opts.fallback);
  }

  if (opts.caches) {
    caches = opts.caches;
  }

  return new MultiLevelCache({
    maxAge: opts.maxAge,
    maxStaleness: opts.maxStaleness,
    caches,
    shouldCache: opts.shouldCache
  });
}
/**
 * Creates a cache object to be used for an Out of Band Cache
 *
 * @param {Object} opts                           - Options for the cache instance.
 * @param {String} [opts.fsCachePath]             - The path to use for file-system caching. Disables FS caching if omitted.
 * @param {Number} opts.maxAge                    - The duration in milliseconds before a cached item expires.
 * @param {Number} opts.maxStaleness              - The duration in milliseconds in which expired cache items are still served.
 * @param {ShouldCache} [opts.shouldCache]        - Function to determine whether to not we should cache the result
 * @param {ShouldCache} [opts.fallback[Cache]]    - An array of additional caches provided by the consumer of the application
 * @returns {MultiLevelCache} a new cache object
 */
Creates a cache object to be used for an Out of Band Cache
@param {Object} opts                           - Options for the cache instance.
@param {String} [opts.fsCachePath]             - The path to use for file-system caching. Disables FS caching if omitted.
@param {Number} opts.maxAge                    - The duration in milliseconds before a cached item expires.
@param {Number} opts.maxStaleness              - The duration in milliseconds in which expired cache items are still served.
@param {ShouldCache} [opts.shouldCache]        - Function to determine whether to not we should cache the result
@param {ShouldCache} [opts.fallback[Cache]]    - An array of additional caches provided by the consumer of the application
@returns {MultiLevelCache} a new cache object
Creates a cache object to be used for an Out of Band Cache @param { Object } opts - Options for the cache instance . @param { String } [ opts . fsCachePath ] - The path to use for file - system caching . Disables FS caching if omitted . @param { Number } opts . maxAge - The duration in milliseconds before a cached item expires . @param { Number } opts . maxStaleness - The duration in milliseconds in which expired cache items are still served . @param { ShouldCache } [ opts . shouldCache ] - Function to determine whether to not we should cache the result @param { ShouldCache } [ opts . fallback [ Cache ]] - An array of additional caches provided by the consumer of the application @returns { MultiLevelCache } a new cache object
function Cache(opts) {
  let caches = [
    new MemoryStorage()
  ];
  if (opts.fsCachePath) {
    caches.push(new FSStorage({ path: opts.fsCachePath }));
  }
  if (opts.fallback) {
    caches.push(...opts.fallback);
  }
  if (opts.caches) {
    caches = opts.caches;
  }
  return new MultiLevelCache({
    maxAge: opts.maxAge,
    maxStaleness: opts.maxStaleness,
    caches,
    shouldCache: opts.shouldCache
  });
}
function Cache ( opts ) { let caches = [ new MemoryStorage ( ) ] ; if ( opts . fsCachePath ) { caches . push ( new FSStorage ( { path : opts . fsCachePath } ) ) ; } if ( opts . fallback ) { caches . push ( ... opts . fallback ) ; } if ( opts . caches ) { caches = opts . caches ; } return new MultiLevelCache ( { maxAge : opts . maxAge , maxStaleness : opts . maxStaleness , caches , shouldCache : opts . shouldCache } ) ; }
Creates a cache object to be used for an Out of Band Cache
 @param {Object} opts                           - Options for the cache instance.
Creates a cache object to be used for an Out of Band Cache @param { Object } opts - Options for the cache instance .