/
lostSun
/
project-client-server-apps
Обзор
Документация
Войти
/
lostSun
/
project-client-server-apps
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js
30 строк
1 KB
1lostsun
initial commit
05 май 2025, 11:35
05 май 2025, 11:35
fe8f535
Код
Авторство
О чём код?
/* Copyright 2020 Google LLC Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT. */ import '../_version.js'; /** * A plugin, designed to be used with PrecacheController, to translate URLs into * the corresponding cache key, based on the current revision info. * * @private */ class PrecacheCacheKeyPlugin { constructor({ precacheController }) { this.cacheKeyWillBeUsed = async ({ request, params, }) => { // Params is type any, can't change right now. /* eslint-disable */ const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) || this._precacheController.getCacheKeyForURL(request.url); /* eslint-enable */ return cacheKey ? new Request(cacheKey, { headers: request.headers }) : request; }; this._precacheController = precacheController; } } export { PrecacheCacheKeyPlugin };