UNPKG

typescript-cacheable

Version:

An in-memory caching (memoization) decorator for Typescript

22 lines 860 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.optionsWithDefaults = void 0; function optionsWithDefaults(options) { let getStore = undefined; if (options !== undefined && options.scope === 'LOCAL_STORAGE') { if (options.getStore === undefined) { throw 'store function must be provided for LOCAL_STORAGE'; } else { getStore = options.getStore; } } return { scope: options && options.scope != undefined ? options.scope : 'GLOBAL', ttl: options && options.ttl != undefined ? options.ttl : undefined, cacheUndefined: options && options.cacheUndefined != undefined ? options.cacheUndefined : true, getStore: getStore, }; } exports.optionsWithDefaults = optionsWithDefaults; //# sourceMappingURL=CacheableOptions.js.map