summaryrefslogtreecommitdiff
path: root/node_modules/swup/src/helpers/matchPath.ts
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/swup/src/helpers/matchPath.ts')
-rw-r--r--node_modules/swup/src/helpers/matchPath.ts23
1 files changed, 0 insertions, 23 deletions
diff --git a/node_modules/swup/src/helpers/matchPath.ts b/node_modules/swup/src/helpers/matchPath.ts
deleted file mode 100644
index e1332911..00000000
--- a/node_modules/swup/src/helpers/matchPath.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { match } from 'path-to-regexp';
-
-import type {
- Path,
- ParseOptions,
- TokensToRegexpOptions,
- RegexpToFunctionOptions,
- MatchFunction
-} from 'path-to-regexp';
-
-export { type Path };
-
-/** Create a match function from a path pattern that checks if a URLs matches it. */
-export const matchPath = <P extends object = object>(
- path: Path,
- options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions
-): MatchFunction<P> => {
- try {
- return match<P>(path, options);
- } catch (error) {
- throw new Error(`[swup] Error parsing path "${String(path)}":\n${String(error)}`);
- }
-};