serwist 9.2.3 → 9.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PrecacheRoute.d.ts.map +1 -1
- package/dist/RegExpRoute.d.ts +1 -1
- package/dist/RegExpRoute.d.ts.map +1 -1
- package/dist/Serwist.d.ts +2 -4
- package/dist/Serwist.d.ts.map +1 -1
- package/dist/chunks/printInstallDetails.js +1113 -1113
- package/dist/chunks/waitUntil.js +83 -83
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.internal.d.ts +2 -2
- package/dist/index.internal.d.ts.map +1 -1
- package/dist/index.internal.js +1 -1
- package/dist/index.js +1319 -1319
- package/dist/index.legacy.d.ts +5 -5
- package/dist/index.legacy.d.ts.map +1 -1
- package/dist/index.legacy.js +30 -31
- package/dist/legacy/PrecacheController.d.ts +1 -2
- package/dist/legacy/PrecacheController.d.ts.map +1 -1
- package/dist/legacy/PrecacheRoute.d.ts.map +1 -1
- package/dist/legacy/Router.d.ts +1 -1
- package/dist/legacy/Router.d.ts.map +1 -1
- package/dist/legacy/fallbacks.d.ts.map +1 -1
- package/dist/legacy/handlePrecaching.d.ts.map +1 -1
- package/dist/legacy/initializeGoogleAnalytics.d.ts.map +1 -1
- package/dist/legacy/installSerwist.d.ts +2 -2
- package/dist/legacy/installSerwist.d.ts.map +1 -1
- package/dist/legacy/registerRoute.d.ts +1 -1
- package/dist/legacy/registerRoute.d.ts.map +1 -1
- package/dist/legacy/registerRuntimeCaching.d.ts.map +1 -1
- package/dist/lib/googleAnalytics/initializeGoogleAnalytics.d.ts.map +1 -1
- package/dist/lib/strategies/NetworkFirst.d.ts.map +1 -1
- package/dist/lib/strategies/PrecacheStrategy.d.ts.map +1 -1
- package/dist/lib/strategies/StaleWhileRevalidate.d.ts.map +1 -1
- package/dist/lib/strategies/StrategyHandler.d.ts.map +1 -1
- package/dist/setCacheNameDetails.d.ts.map +1 -1
- package/dist/utils/createCacheKey.d.ts.map +1 -1
- package/dist/utils/parseRoute.d.ts +1 -1
- package/dist/utils/parseRoute.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/PrecacheRoute.ts +1 -2
- package/src/RegExpRoute.ts +1 -1
- package/src/Serwist.ts +12 -10
- package/src/copyResponse.ts +1 -1
- package/src/index.internal.ts +2 -2
- package/src/index.legacy.ts +5 -5
- package/src/index.ts +9 -9
- package/src/legacy/PrecacheController.ts +3 -4
- package/src/legacy/PrecacheRoute.ts +1 -2
- package/src/legacy/Router.ts +2 -2
- package/src/legacy/fallbacks.ts +1 -3
- package/src/legacy/handlePrecaching.ts +1 -1
- package/src/legacy/initializeGoogleAnalytics.ts +2 -2
- package/src/legacy/installSerwist.ts +3 -3
- package/src/legacy/matchPrecache.ts +1 -1
- package/src/legacy/precache.ts +1 -1
- package/src/legacy/registerRoute.ts +4 -3
- package/src/legacy/registerRuntimeCaching.ts +1 -2
- package/src/lib/backgroundSync/BackgroundSyncQueue.ts +1 -1
- package/src/lib/broadcastUpdate/responsesAreSame.ts +1 -1
- package/src/lib/cacheableResponse/CacheableResponse.ts +1 -1
- package/src/lib/expiration/CacheExpiration.ts +1 -1
- package/src/lib/expiration/ExpirationPlugin.ts +2 -2
- package/src/lib/googleAnalytics/initializeGoogleAnalytics.ts +2 -2
- package/src/lib/rangeRequests/createPartialResponse.ts +1 -1
- package/src/lib/rangeRequests/utils/calculateEffectiveBoundaries.ts +1 -1
- package/src/lib/rangeRequests/utils/parseRangeHeader.ts +1 -1
- package/src/lib/strategies/CacheFirst.ts +1 -1
- package/src/lib/strategies/CacheOnly.ts +1 -1
- package/src/lib/strategies/NetworkFirst.ts +2 -2
- package/src/lib/strategies/NetworkOnly.ts +1 -1
- package/src/lib/strategies/PrecacheStrategy.ts +2 -2
- package/src/lib/strategies/StaleWhileRevalidate.ts +2 -2
- package/src/lib/strategies/Strategy.ts +1 -1
- package/src/lib/strategies/StrategyHandler.ts +3 -3
- package/src/setCacheNameDetails.ts +1 -1
- package/src/utils/createCacheKey.ts +1 -2
- package/src/utils/parseRoute.ts +2 -2
|
@@ -6,16 +6,15 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Route } from "../Route.js";
|
|
10
9
|
import { BackgroundSyncPlugin } from "../lib/backgroundSync/BackgroundSyncPlugin.js";
|
|
11
10
|
import type { BackgroundSyncQueue, BackgroundSyncQueueEntry } from "../lib/backgroundSync/BackgroundSyncQueue.js";
|
|
12
11
|
import { NetworkFirst } from "../lib/strategies/NetworkFirst.js";
|
|
13
12
|
import { NetworkOnly } from "../lib/strategies/NetworkOnly.js";
|
|
13
|
+
import { Route } from "../Route.js";
|
|
14
14
|
import type { RouteMatchCallbackOptions } from "../types.js";
|
|
15
15
|
import { cacheNames as privateCacheNames } from "../utils/cacheNames.js";
|
|
16
16
|
import { getFriendlyURL } from "../utils/getFriendlyURL.js";
|
|
17
17
|
import { logger } from "../utils/logger.js";
|
|
18
|
-
import type { Router } from "./Router.js";
|
|
19
18
|
import {
|
|
20
19
|
ANALYTICS_JS_PATH,
|
|
21
20
|
COLLECT_PATHS_REGEX,
|
|
@@ -26,6 +25,7 @@ import {
|
|
|
26
25
|
MAX_RETENTION_TIME,
|
|
27
26
|
QUEUE_NAME,
|
|
28
27
|
} from "./constants.js";
|
|
28
|
+
import type { Router } from "./Router.js";
|
|
29
29
|
import { getSingletonRouter } from "./singletonRouter.js";
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -3,13 +3,13 @@ import { enableNavigationPreload } from "../navigationPreload.js";
|
|
|
3
3
|
import { setCacheNameDetails } from "../setCacheNameDetails.js";
|
|
4
4
|
import type { RuntimeCaching } from "../types.js";
|
|
5
5
|
import { clientsClaim as clientsClaimImpl } from "../utils/clientsClaim.js";
|
|
6
|
-
import type { PrecacheController } from "./PrecacheController.js";
|
|
7
|
-
import type { Router } from "./Router.js";
|
|
8
6
|
import type { FallbacksOptions } from "./fallbacks.js";
|
|
9
7
|
import { fallbacks as fallbacksImpl } from "./fallbacks.js";
|
|
10
8
|
import { type HandlePrecachingOptions, handlePrecaching } from "./handlePrecaching.js";
|
|
11
|
-
import { initializeGoogleAnalytics } from "./initializeGoogleAnalytics.js";
|
|
12
9
|
import type { GoogleAnalyticsInitializeOptions } from "./initializeGoogleAnalytics.js";
|
|
10
|
+
import { initializeGoogleAnalytics } from "./initializeGoogleAnalytics.js";
|
|
11
|
+
import type { PrecacheController } from "./PrecacheController.js";
|
|
12
|
+
import type { Router } from "./Router.js";
|
|
13
13
|
import { registerRuntimeCaching } from "./registerRuntimeCaching.js";
|
|
14
14
|
import { getSingletonPrecacheController } from "./singletonPrecacheController.js";
|
|
15
15
|
import { getSingletonRouter } from "./singletonRouter.js";
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { getSingletonPrecacheController } from "./singletonPrecacheController.js";
|
|
10
9
|
import type { PrecacheController } from "./PrecacheController.js";
|
|
10
|
+
import { getSingletonPrecacheController } from "./singletonPrecacheController.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Helper function that calls {@linkcode PrecacheController.matchPrecache}
|
package/src/legacy/precache.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { PrecacheEntry } from "../types.js";
|
|
10
|
-
import { getSingletonPrecacheController } from "./singletonPrecacheController.js";
|
|
11
10
|
import type { addRoute } from "./addRoute.js";
|
|
12
11
|
import type { precacheAndRoute } from "./precacheAndRoute.js";
|
|
12
|
+
import { getSingletonPrecacheController } from "./singletonPrecacheController.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Adds items to the precache list, removing any duplicates and
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
license that can be found in the LICENSE file or at
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import type { Route } from "../Route.js";
|
|
8
|
+
|
|
10
9
|
import type { HTTPMethod } from "../constants.js";
|
|
10
|
+
import type { Route } from "../Route.js";
|
|
11
11
|
import type { RouteHandler, RouteMatchCallback } from "../types.js";
|
|
12
|
-
import type {
|
|
12
|
+
import type { Router } from "./Router.js";
|
|
13
13
|
import { getSingletonRouter } from "./singletonRouter.js";
|
|
14
|
+
import type { unregisterRoute } from "./unregisterRoute.js";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Registers a `RegExp`, string, or function with a caching
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2018 Google LLC
|
|
4
3
|
|
|
@@ -9,6 +8,7 @@ import { SerwistError } from "../../utils/SerwistError.js";
|
|
|
9
8
|
import { assert } from "../../utils/assert.js";
|
|
10
9
|
import { getFriendlyURL } from "../../utils/getFriendlyURL.js";
|
|
11
10
|
import { logger } from "../../utils/logger.js";
|
|
11
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
12
|
import type { BackgroundSyncQueueStoreEntry, UnidentifiedQueueStoreEntry } from "./BackgroundSyncQueueDb.js";
|
|
13
13
|
import { BackgroundSyncQueueStore } from "./BackgroundSyncQueueStore.js";
|
|
14
14
|
import { StorableRequest } from "./StorableRequest.js";
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
10
9
|
import { logger } from "../../utils/logger.js";
|
|
10
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Given two responses, compares several header values to see if they are
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../utils/assert.js";
|
|
11
10
|
import { getFriendlyURL } from "../../utils/getFriendlyURL.js";
|
|
12
11
|
import { logger } from "../../utils/logger.js";
|
|
12
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
13
13
|
|
|
14
14
|
export interface CacheableResponseOptions {
|
|
15
15
|
/**
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../utils/assert.js";
|
|
11
10
|
import { logger } from "../../utils/logger.js";
|
|
11
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
12
|
import { CacheTimestampsModel } from "./models/CacheTimestampsModel.js";
|
|
13
13
|
|
|
14
14
|
interface CacheExpirationConfig {
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
import { registerQuotaErrorCallback } from "../../registerQuotaErrorCallback.js";
|
|
10
10
|
import type { CacheDidUpdateCallbackParam, CachedResponseWillBeUsedCallbackParam, SerwistPlugin } from "../../types.js";
|
|
11
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
11
|
import { assert } from "../../utils/assert.js";
|
|
13
12
|
import { cacheNames as privateCacheNames } from "../../utils/cacheNames.js";
|
|
14
13
|
import { getFriendlyURL } from "../../utils/getFriendlyURL.js";
|
|
15
14
|
import { logger } from "../../utils/logger.js";
|
|
16
|
-
import {
|
|
15
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
17
16
|
import type { Strategy } from "../strategies/Strategy.js";
|
|
17
|
+
import { CacheExpiration } from "./CacheExpiration.js";
|
|
18
18
|
|
|
19
19
|
export interface ExpirationPluginOptions {
|
|
20
20
|
/**
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Route } from "../../Route.js";
|
|
10
|
-
import type { Serwist } from "../../Serwist.js";
|
|
11
9
|
import { NetworkFirst } from "../../lib/strategies/NetworkFirst.js";
|
|
12
10
|
import { NetworkOnly } from "../../lib/strategies/NetworkOnly.js";
|
|
11
|
+
import { Route } from "../../Route.js";
|
|
12
|
+
import type { Serwist } from "../../Serwist.js";
|
|
13
13
|
import type { RouteMatchCallbackOptions } from "../../types.js";
|
|
14
14
|
import { cacheNames as privateCacheNames } from "../../utils/cacheNames.js";
|
|
15
15
|
import { getFriendlyURL } from "../../utils/getFriendlyURL.js";
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../utils/assert.js";
|
|
11
10
|
import { logger } from "../../utils/logger.js";
|
|
11
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
12
|
import { calculateEffectiveBoundaries } from "./utils/calculateEffectiveBoundaries.js";
|
|
13
13
|
import { parseRangeHeader } from "./utils/parseRangeHeader.js";
|
|
14
14
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../../utils/assert.js";
|
|
10
|
+
import { SerwistError } from "../../../utils/SerwistError.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @param blob A source blob.
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../../utils/assert.js";
|
|
10
|
+
import { SerwistError } from "../../../utils/SerwistError.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @param rangeHeader A `Range` header value.
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../utils/assert.js";
|
|
11
10
|
import { logger } from "../../utils/logger.js";
|
|
11
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
12
|
import { Strategy } from "./Strategy.js";
|
|
13
13
|
import type { StrategyHandler } from "./StrategyHandler.js";
|
|
14
14
|
import { messages } from "./utils/messages.js";
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../utils/assert.js";
|
|
11
10
|
import { logger } from "../../utils/logger.js";
|
|
11
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
12
|
import { Strategy } from "./Strategy.js";
|
|
13
13
|
import type { StrategyHandler } from "./StrategyHandler.js";
|
|
14
14
|
import { messages } from "./utils/messages.js";
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../utils/assert.js";
|
|
11
10
|
import { logger } from "../../utils/logger.js";
|
|
11
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
|
+
import { cacheOkAndOpaquePlugin } from "./plugins/cacheOkAndOpaquePlugin.js";
|
|
12
13
|
import type { StrategyOptions } from "./Strategy.js";
|
|
13
14
|
import { Strategy } from "./Strategy.js";
|
|
14
15
|
import type { StrategyHandler } from "./StrategyHandler.js";
|
|
15
|
-
import { cacheOkAndOpaquePlugin } from "./plugins/cacheOkAndOpaquePlugin.js";
|
|
16
16
|
import { messages } from "./utils/messages.js";
|
|
17
17
|
|
|
18
18
|
export interface NetworkFirstOptions extends StrategyOptions {
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../utils/assert.js";
|
|
11
10
|
import { logger } from "../../utils/logger.js";
|
|
11
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
12
|
import { timeout } from "../../utils/timeout.js";
|
|
13
13
|
import type { StrategyOptions } from "./Strategy.js";
|
|
14
14
|
import { Strategy } from "./Strategy.js";
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { copyResponse } from "../../copyResponse.js";
|
|
10
|
+
import type { Serwist } from "../../Serwist.js";
|
|
10
11
|
import type { SerwistPlugin } from "../../types.js";
|
|
11
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
12
|
import { cacheNames as privateCacheNames } from "../../utils/cacheNames.js";
|
|
13
13
|
import { getFriendlyURL } from "../../utils/getFriendlyURL.js";
|
|
14
14
|
import { logger } from "../../utils/logger.js";
|
|
15
|
-
import
|
|
15
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
16
16
|
import type { StrategyOptions } from "./Strategy.js";
|
|
17
17
|
import { Strategy } from "./Strategy.js";
|
|
18
18
|
import type { StrategyHandler } from "./StrategyHandler.js";
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
10
9
|
import { assert } from "../../utils/assert.js";
|
|
11
10
|
import { logger } from "../../utils/logger.js";
|
|
11
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
|
+
import { cacheOkAndOpaquePlugin } from "./plugins/cacheOkAndOpaquePlugin.js";
|
|
12
13
|
import type { StrategyOptions } from "./Strategy.js";
|
|
13
14
|
import { Strategy } from "./Strategy.js";
|
|
14
15
|
import type { StrategyHandler } from "./StrategyHandler.js";
|
|
15
|
-
import { cacheOkAndOpaquePlugin } from "./plugins/cacheOkAndOpaquePlugin.js";
|
|
16
16
|
import { messages } from "./utils/messages.js";
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { HandlerCallbackOptions, RouteHandlerObject, SerwistPlugin } from "../../types.js";
|
|
10
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
11
10
|
import { cacheNames as privateCacheNames } from "../../utils/cacheNames.js";
|
|
12
11
|
import { getFriendlyURL } from "../../utils/getFriendlyURL.js";
|
|
13
12
|
import { logger } from "../../utils/logger.js";
|
|
13
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
14
14
|
import { StrategyHandler } from "./StrategyHandler.js";
|
|
15
15
|
|
|
16
16
|
export interface StrategyOptions {
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import type { Route } from "../../Route.js";
|
|
9
10
|
import type { HandlerCallbackOptions, MapLikeObject, SerwistPlugin, SerwistPluginCallbackParam } from "../../types.js";
|
|
10
|
-
import { Deferred } from "../../utils/Deferred.js";
|
|
11
|
-
import { SerwistError } from "../../utils/SerwistError.js";
|
|
12
11
|
import { assert } from "../../utils/assert.js";
|
|
13
12
|
import { cacheMatchIgnoreParams } from "../../utils/cacheMatchIgnoreParams.js";
|
|
13
|
+
import { Deferred } from "../../utils/Deferred.js";
|
|
14
14
|
import { executeQuotaErrorCallbacks } from "../../utils/executeQuotaErrorCallbacks.js";
|
|
15
15
|
import { getFriendlyURL } from "../../utils/getFriendlyURL.js";
|
|
16
16
|
import { logger } from "../../utils/logger.js";
|
|
17
|
+
import { SerwistError } from "../../utils/SerwistError.js";
|
|
17
18
|
import { timeout } from "../../utils/timeout.js";
|
|
18
19
|
import type { Strategy } from "./Strategy.js";
|
|
19
|
-
import type { Route } from "../../Route.js";
|
|
20
20
|
|
|
21
21
|
function toRequest(input: RequestInfo) {
|
|
22
22
|
return typeof input === "string" ? new Request(input) : input;
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
https://opensource.org/licenses/MIT.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { SerwistError } from "./utils/SerwistError.js";
|
|
10
9
|
import { assert } from "./utils/assert.js";
|
|
11
10
|
import type { PartialCacheNameDetails } from "./utils/cacheNames.js";
|
|
12
11
|
import { cacheNames } from "./utils/cacheNames.js";
|
|
12
|
+
import { SerwistError } from "./utils/SerwistError.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Modifies the default cache names used by Serwist packages.
|
package/src/utils/parseRoute.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { HTTPMethod } from "../constants.js";
|
|
1
2
|
import { RegExpRoute } from "../RegExpRoute.js";
|
|
2
3
|
import { Route } from "../Route.js";
|
|
3
|
-
import type { HTTPMethod } from "../constants.js";
|
|
4
4
|
import type { RouteHandler, RouteMatchCallback } from "../types.js";
|
|
5
|
-
import { SerwistError } from "./SerwistError.js";
|
|
6
5
|
import { logger } from "./logger.js";
|
|
6
|
+
import { SerwistError } from "./SerwistError.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Parses a `RegExp`, string, or function with a caching strategy into a {@linkcode Route}. This is for
|