diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:10:59 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-05-18 23:41:44 +0800 |
| commit | fc87c009806dcc98867f6b58efe29b042aa01dee (patch) | |
| tree | 8f59b3f4a5b66e9dfef2d40c8d318e258a521228 /node_modules/swup/src/helpers/matchPath.ts | |
| parent | 3336b2356ee6152d9c6ae59bd9b87ccbc0958407 (diff) | |
node: updatemain
Diffstat (limited to 'node_modules/swup/src/helpers/matchPath.ts')
| -rw-r--r-- | node_modules/swup/src/helpers/matchPath.ts | 23 |
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)}`); - } -}; |
