Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(options: NetworkFirstOptions = {}) {
this._cacheName = cacheNames.getRuntimeName(options.cacheName);
if (options.plugins) {
let isUsingCacheWillUpdate =
options.plugins.some((plugin) => !!plugin.cacheWillUpdate);
this._plugins = isUsingCacheWillUpdate ?
options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];
} else {
// No plugins passed in, use the default plugin.
this._plugins = [cacheOkAndOpaquePlugin];
}
this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;
if (process.env.NODE_ENV !== 'production') {
if (this._networkTimeoutSeconds) {
assert!.isType(this._networkTimeoutSeconds, 'number', {
moduleName: 'workbox-strategies',
constructor(options: StaleWhileRevalidateOptions = {}) {
this._cacheName = cacheNames.getRuntimeName(options.cacheName);
this._plugins = options.plugins || [];
if (options.plugins) {
let isUsingCacheWillUpdate =
options.plugins.some((plugin) => !!plugin.cacheWillUpdate);
this._plugins = isUsingCacheWillUpdate ?
options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];
} else {
// No plugins passed in, use the default plugin.
this._plugins = [cacheOkAndOpaquePlugin];
}
this._fetchOptions = options.fetchOptions;
this._matchOptions = options.matchOptions;
}
constructor(options: CacheFirstOptions = {}) {
this._cacheName = cacheNames.getRuntimeName(options.cacheName);
this._plugins = options.plugins || [];
this._fetchOptions = options.fetchOptions;
this._matchOptions = options.matchOptions;
}
constructor(options: CacheOnlyOptions = {}) {
this._cacheName = cacheNames.getRuntimeName(options.cacheName);
this._plugins = options.plugins || [];
this._matchOptions = options.matchOptions;
}