@tanstack/router-core 1.136.3 → 1.136.5

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.
Files changed (70) hide show
  1. package/dist/cjs/Matches.cjs.map +1 -1
  2. package/dist/cjs/Matches.d.cts +2 -0
  3. package/dist/cjs/index.cjs +0 -5
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/index.d.cts +1 -4
  6. package/dist/cjs/lru-cache.cjs +5 -0
  7. package/dist/cjs/lru-cache.cjs.map +1 -1
  8. package/dist/cjs/lru-cache.d.cts +1 -0
  9. package/dist/cjs/new-process-route-tree.cjs +655 -0
  10. package/dist/cjs/new-process-route-tree.cjs.map +1 -0
  11. package/dist/cjs/new-process-route-tree.d.cts +177 -0
  12. package/dist/cjs/path.cjs +133 -434
  13. package/dist/cjs/path.cjs.map +1 -1
  14. package/dist/cjs/path.d.cts +3 -39
  15. package/dist/cjs/router.cjs +47 -98
  16. package/dist/cjs/router.cjs.map +1 -1
  17. package/dist/cjs/router.d.cts +7 -11
  18. package/dist/cjs/ssr/constants.cjs.map +1 -1
  19. package/dist/cjs/ssr/constants.d.cts +1 -0
  20. package/dist/cjs/ssr/ssr-client.cjs +2 -0
  21. package/dist/cjs/ssr/ssr-client.cjs.map +1 -1
  22. package/dist/cjs/ssr/ssr-client.d.cts +4 -1
  23. package/dist/cjs/ssr/ssr-server.cjs +64 -12
  24. package/dist/cjs/ssr/ssr-server.cjs.map +1 -1
  25. package/dist/cjs/ssr/tsrScript.cjs +1 -1
  26. package/dist/cjs/ssr/tsrScript.cjs.map +1 -1
  27. package/dist/esm/Matches.d.ts +2 -0
  28. package/dist/esm/Matches.js.map +1 -1
  29. package/dist/esm/index.d.ts +1 -4
  30. package/dist/esm/index.js +1 -6
  31. package/dist/esm/index.js.map +1 -1
  32. package/dist/esm/lru-cache.d.ts +1 -0
  33. package/dist/esm/lru-cache.js +5 -0
  34. package/dist/esm/lru-cache.js.map +1 -1
  35. package/dist/esm/new-process-route-tree.d.ts +177 -0
  36. package/dist/esm/new-process-route-tree.js +655 -0
  37. package/dist/esm/new-process-route-tree.js.map +1 -0
  38. package/dist/esm/path.d.ts +3 -39
  39. package/dist/esm/path.js +133 -434
  40. package/dist/esm/path.js.map +1 -1
  41. package/dist/esm/router.d.ts +7 -11
  42. package/dist/esm/router.js +48 -99
  43. package/dist/esm/router.js.map +1 -1
  44. package/dist/esm/ssr/constants.d.ts +1 -0
  45. package/dist/esm/ssr/constants.js.map +1 -1
  46. package/dist/esm/ssr/ssr-client.d.ts +4 -1
  47. package/dist/esm/ssr/ssr-client.js +2 -0
  48. package/dist/esm/ssr/ssr-client.js.map +1 -1
  49. package/dist/esm/ssr/ssr-server.js +64 -12
  50. package/dist/esm/ssr/ssr-server.js.map +1 -1
  51. package/dist/esm/ssr/tsrScript.js +1 -1
  52. package/dist/esm/ssr/tsrScript.js.map +1 -1
  53. package/package.json +1 -1
  54. package/src/Matches.ts +2 -0
  55. package/src/index.ts +0 -6
  56. package/src/lru-cache.ts +6 -0
  57. package/src/new-process-route-tree.ts +1036 -0
  58. package/src/path.ts +168 -639
  59. package/src/router.ts +58 -126
  60. package/src/ssr/constants.ts +1 -0
  61. package/src/ssr/ssr-client.ts +10 -1
  62. package/src/ssr/ssr-server.ts +69 -12
  63. package/src/ssr/tsrScript.ts +4 -0
  64. package/dist/cjs/process-route-tree.cjs +0 -144
  65. package/dist/cjs/process-route-tree.cjs.map +0 -1
  66. package/dist/cjs/process-route-tree.d.cts +0 -18
  67. package/dist/esm/process-route-tree.d.ts +0 -18
  68. package/dist/esm/process-route-tree.js +0 -144
  69. package/dist/esm/process-route-tree.js.map +0 -1
  70. package/src/process-route-tree.ts +0 -241
@@ -1 +1 @@
1
- {"version":3,"file":"Matches.cjs","sources":["../../src/Matches.ts"],"sourcesContent":["import type { AnyRoute, StaticDataRouteOption } from './route'\nimport type {\n AllContext,\n AllLoaderData,\n AllParams,\n FullSearchSchema,\n ParseRoute,\n RouteById,\n RouteIds,\n} from './routeInfo'\nimport type { AnyRouter, RegisteredRouter, SSROption } from './router'\nimport type { Constrain, ControlledPromise } from './utils'\n\nexport type AnyMatchAndValue = { match: any; value: any }\n\nexport type FindValueByIndex<\n TKey,\n TValue extends ReadonlyArray<any>,\n> = TKey extends `${infer TIndex extends number}` ? TValue[TIndex] : never\n\nexport type FindValueByKey<TKey, TValue> =\n TValue extends ReadonlyArray<any>\n ? FindValueByIndex<TKey, TValue>\n : TValue[TKey & keyof TValue]\n\nexport type CreateMatchAndValue<TMatch, TValue> = TValue extends any\n ? {\n match: TMatch\n value: TValue\n }\n : never\n\nexport type NextMatchAndValue<\n TKey,\n TMatchAndValue extends AnyMatchAndValue,\n> = TMatchAndValue extends any\n ? CreateMatchAndValue<\n TMatchAndValue['match'],\n FindValueByKey<TKey, TMatchAndValue['value']>\n >\n : never\n\nexport type IsMatchKeyOf<TValue> =\n TValue extends ReadonlyArray<any>\n ? number extends TValue['length']\n ? `${number}`\n : keyof TValue & `${number}`\n : TValue extends object\n ? keyof TValue & string\n : never\n\nexport type IsMatchPath<\n TParentPath extends string,\n TMatchAndValue extends AnyMatchAndValue,\n> = `${TParentPath}${IsMatchKeyOf<TMatchAndValue['value']>}`\n\nexport type IsMatchResult<\n TKey,\n TMatchAndValue extends AnyMatchAndValue,\n> = TMatchAndValue extends any\n ? TKey extends keyof TMatchAndValue['value']\n ? TMatchAndValue['match']\n : never\n : never\n\nexport type IsMatchParse<\n TPath,\n TMatchAndValue extends AnyMatchAndValue,\n TParentPath extends string = '',\n> = TPath extends `${string}.${string}`\n ? TPath extends `${infer TFirst}.${infer TRest}`\n ? IsMatchParse<\n TRest,\n NextMatchAndValue<TFirst, TMatchAndValue>,\n `${TParentPath}${TFirst}.`\n >\n : never\n : {\n path: IsMatchPath<TParentPath, TMatchAndValue>\n result: IsMatchResult<TPath, TMatchAndValue>\n }\n\nexport type IsMatch<TMatch, TPath> = IsMatchParse<\n TPath,\n TMatch extends any ? { match: TMatch; value: TMatch } : never\n>\n\n/**\n * Narrows matches based on a path\n * @experimental\n */\nexport const isMatch = <TMatch, TPath extends string>(\n match: TMatch,\n path: Constrain<TPath, IsMatch<TMatch, TPath>['path']>,\n): match is IsMatch<TMatch, TPath>['result'] => {\n const parts = (path as string).split('.')\n let part\n let i = 0\n let value: any = match\n\n while ((part = parts[i++]) != null && value != null) {\n value = value[part]\n }\n\n return value != null\n}\n\nexport interface DefaultRouteMatchExtensions {\n scripts?: unknown\n links?: unknown\n headScripts?: unknown\n meta?: unknown\n styles?: unknown\n}\n\nexport interface RouteMatchExtensions extends DefaultRouteMatchExtensions {}\n\nexport interface RouteMatch<\n out TRouteId,\n out TFullPath,\n out TAllParams,\n out TFullSearchSchema,\n out TLoaderData,\n out TAllContext,\n out TLoaderDeps,\n> extends RouteMatchExtensions {\n id: string\n routeId: TRouteId\n fullPath: TFullPath\n index: number\n pathname: string\n params: TAllParams\n _strictParams: TAllParams\n status: 'pending' | 'success' | 'error' | 'redirected' | 'notFound'\n isFetching: false | 'beforeLoad' | 'loader'\n error: unknown\n paramsError: unknown\n searchError: unknown\n updatedAt: number\n _nonReactive: {\n /** @internal */\n beforeLoadPromise?: ControlledPromise<void>\n /** @internal */\n loaderPromise?: ControlledPromise<void>\n /** @internal */\n pendingTimeout?: ReturnType<typeof setTimeout>\n loadPromise?: ControlledPromise<void>\n displayPendingPromise?: Promise<void>\n minPendingPromise?: ControlledPromise<void>\n dehydrated?: boolean\n /** @internal */\n error?: unknown\n }\n loaderData?: TLoaderData\n /** @internal */\n __routeContext?: Record<string, unknown>\n /** @internal */\n __beforeLoadContext?: Record<string, unknown>\n context: TAllContext\n search: TFullSearchSchema\n _strictSearch: TFullSearchSchema\n fetchCount: number\n abortController: AbortController\n cause: 'preload' | 'enter' | 'stay'\n loaderDeps: TLoaderDeps\n preload: boolean\n invalid: boolean\n headers?: Record<string, string>\n globalNotFound?: boolean\n staticData: StaticDataRouteOption\n /** This attribute is not reactive */\n ssr?: SSROption\n _forcePending?: boolean\n _displayPending?: boolean\n}\n\nexport interface PreValidationErrorHandlingRouteMatch<\n TRouteId,\n TFullPath,\n TAllParams,\n TFullSearchSchema,\n> {\n id: string\n routeId: TRouteId\n fullPath: TFullPath\n index: number\n pathname: string\n search:\n | { status: 'success'; value: TFullSearchSchema }\n | { status: 'error'; error: unknown }\n params:\n | { status: 'success'; value: TAllParams }\n | { status: 'error'; error: unknown }\n staticData: StaticDataRouteOption\n ssr?: boolean | 'data-only'\n}\n\nexport type MakePreValidationErrorHandlingRouteMatchUnion<\n TRouter extends AnyRouter = RegisteredRouter,\n TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>,\n> = TRoute extends any\n ? PreValidationErrorHandlingRouteMatch<\n TRoute['id'],\n TRoute['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema']\n >\n : never\n\nexport type MakeRouteMatchFromRoute<TRoute extends AnyRoute> = RouteMatch<\n TRoute['types']['id'],\n TRoute['types']['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema'],\n TRoute['types']['loaderData'],\n TRoute['types']['allContext'],\n TRoute['types']['loaderDeps']\n>\n\nexport type MakeRouteMatch<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TRouteId = RouteIds<TRouteTree>,\n TStrict extends boolean = true,\n> = RouteMatch<\n TRouteId,\n RouteById<TRouteTree, TRouteId>['types']['fullPath'],\n TStrict extends false\n ? AllParams<TRouteTree>\n : RouteById<TRouteTree, TRouteId>['types']['allParams'],\n TStrict extends false\n ? FullSearchSchema<TRouteTree>\n : RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'],\n TStrict extends false\n ? AllLoaderData<TRouteTree>\n : RouteById<TRouteTree, TRouteId>['types']['loaderData'],\n TStrict extends false\n ? AllContext<TRouteTree>\n : RouteById<TRouteTree, TRouteId>['types']['allContext'],\n RouteById<TRouteTree, TRouteId>['types']['loaderDeps']\n>\n\nexport type AnyRouteMatch = RouteMatch<any, any, any, any, any, any, any>\n\nexport type MakeRouteMatchUnion<\n TRouter extends AnyRouter = RegisteredRouter,\n TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>,\n> = TRoute extends any\n ? RouteMatch<\n TRoute['id'],\n TRoute['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema'],\n TRoute['types']['loaderData'],\n TRoute['types']['allContext'],\n TRoute['types']['loaderDeps']\n >\n : never\n\n/**\n * The `MatchRouteOptions` type is used to describe the options that can be used when matching a route.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#matchrouteoptions-type)\n */\nexport interface MatchRouteOptions {\n /**\n * If `true`, will match against pending location instead of the current location.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#pending-property)\n */\n pending?: boolean\n /**\n * If `true`, will match against the current location with case sensitivity.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#casesensitive-property)\n */\n caseSensitive?: boolean\n /**\n * If `true`, will match against the current location's search params using a deep inclusive check. e.g. `{ a: 1 }` will match for a current location of `{ a: 1, b: 2 }`.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#includesearch-property)\n */\n includeSearch?: boolean\n /**\n * If `true`, will match against the current location using a fuzzy match. e.g. `/posts` will match for a current location of `/posts/123`.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#fuzzy-property)\n */\n fuzzy?: boolean\n}\n"],"names":[],"mappings":";;AA2FO,MAAM,UAAU,CACrB,OACA,SAC8C;AAC9C,QAAM,QAAS,KAAgB,MAAM,GAAG;AACxC,MAAI;AACJ,MAAI,IAAI;AACR,MAAI,QAAa;AAEjB,UAAQ,OAAO,MAAM,GAAG,MAAM,QAAQ,SAAS,MAAM;AACnD,YAAQ,MAAM,IAAI;AAAA,EACpB;AAEA,SAAO,SAAS;AAClB;;"}
1
+ {"version":3,"file":"Matches.cjs","sources":["../../src/Matches.ts"],"sourcesContent":["import type { AnyRoute, StaticDataRouteOption } from './route'\nimport type {\n AllContext,\n AllLoaderData,\n AllParams,\n FullSearchSchema,\n ParseRoute,\n RouteById,\n RouteIds,\n} from './routeInfo'\nimport type { AnyRouter, RegisteredRouter, SSROption } from './router'\nimport type { Constrain, ControlledPromise } from './utils'\n\nexport type AnyMatchAndValue = { match: any; value: any }\n\nexport type FindValueByIndex<\n TKey,\n TValue extends ReadonlyArray<any>,\n> = TKey extends `${infer TIndex extends number}` ? TValue[TIndex] : never\n\nexport type FindValueByKey<TKey, TValue> =\n TValue extends ReadonlyArray<any>\n ? FindValueByIndex<TKey, TValue>\n : TValue[TKey & keyof TValue]\n\nexport type CreateMatchAndValue<TMatch, TValue> = TValue extends any\n ? {\n match: TMatch\n value: TValue\n }\n : never\n\nexport type NextMatchAndValue<\n TKey,\n TMatchAndValue extends AnyMatchAndValue,\n> = TMatchAndValue extends any\n ? CreateMatchAndValue<\n TMatchAndValue['match'],\n FindValueByKey<TKey, TMatchAndValue['value']>\n >\n : never\n\nexport type IsMatchKeyOf<TValue> =\n TValue extends ReadonlyArray<any>\n ? number extends TValue['length']\n ? `${number}`\n : keyof TValue & `${number}`\n : TValue extends object\n ? keyof TValue & string\n : never\n\nexport type IsMatchPath<\n TParentPath extends string,\n TMatchAndValue extends AnyMatchAndValue,\n> = `${TParentPath}${IsMatchKeyOf<TMatchAndValue['value']>}`\n\nexport type IsMatchResult<\n TKey,\n TMatchAndValue extends AnyMatchAndValue,\n> = TMatchAndValue extends any\n ? TKey extends keyof TMatchAndValue['value']\n ? TMatchAndValue['match']\n : never\n : never\n\nexport type IsMatchParse<\n TPath,\n TMatchAndValue extends AnyMatchAndValue,\n TParentPath extends string = '',\n> = TPath extends `${string}.${string}`\n ? TPath extends `${infer TFirst}.${infer TRest}`\n ? IsMatchParse<\n TRest,\n NextMatchAndValue<TFirst, TMatchAndValue>,\n `${TParentPath}${TFirst}.`\n >\n : never\n : {\n path: IsMatchPath<TParentPath, TMatchAndValue>\n result: IsMatchResult<TPath, TMatchAndValue>\n }\n\nexport type IsMatch<TMatch, TPath> = IsMatchParse<\n TPath,\n TMatch extends any ? { match: TMatch; value: TMatch } : never\n>\n\n/**\n * Narrows matches based on a path\n * @experimental\n */\nexport const isMatch = <TMatch, TPath extends string>(\n match: TMatch,\n path: Constrain<TPath, IsMatch<TMatch, TPath>['path']>,\n): match is IsMatch<TMatch, TPath>['result'] => {\n const parts = (path as string).split('.')\n let part\n let i = 0\n let value: any = match\n\n while ((part = parts[i++]) != null && value != null) {\n value = value[part]\n }\n\n return value != null\n}\n\nexport interface DefaultRouteMatchExtensions {\n scripts?: unknown\n links?: unknown\n headScripts?: unknown\n meta?: unknown\n styles?: unknown\n}\n\nexport interface RouteMatchExtensions extends DefaultRouteMatchExtensions {}\n\nexport interface RouteMatch<\n out TRouteId,\n out TFullPath,\n out TAllParams,\n out TFullSearchSchema,\n out TLoaderData,\n out TAllContext,\n out TLoaderDeps,\n> extends RouteMatchExtensions {\n id: string\n routeId: TRouteId\n fullPath: TFullPath\n index: number\n pathname: string\n params: TAllParams\n _strictParams: TAllParams\n status: 'pending' | 'success' | 'error' | 'redirected' | 'notFound'\n isFetching: false | 'beforeLoad' | 'loader'\n error: unknown\n paramsError: unknown\n searchError: unknown\n updatedAt: number\n _nonReactive: {\n /** @internal */\n beforeLoadPromise?: ControlledPromise<void>\n /** @internal */\n loaderPromise?: ControlledPromise<void>\n /** @internal */\n pendingTimeout?: ReturnType<typeof setTimeout>\n loadPromise?: ControlledPromise<void>\n displayPendingPromise?: Promise<void>\n minPendingPromise?: ControlledPromise<void>\n dehydrated?: boolean\n /** @internal */\n error?: unknown\n }\n loaderData?: TLoaderData\n /** @internal */\n __routeContext?: Record<string, unknown>\n /** @internal */\n __beforeLoadContext?: Record<string, unknown>\n context: TAllContext\n search: TFullSearchSchema\n _strictSearch: TFullSearchSchema\n fetchCount: number\n abortController: AbortController\n cause: 'preload' | 'enter' | 'stay'\n loaderDeps: TLoaderDeps\n preload: boolean\n invalid: boolean\n headers?: Record<string, string>\n globalNotFound?: boolean\n staticData: StaticDataRouteOption\n /** This attribute is not reactive */\n ssr?: SSROption\n _forcePending?: boolean\n _displayPending?: boolean\n}\n\nexport interface PreValidationErrorHandlingRouteMatch<\n TRouteId,\n TFullPath,\n TAllParams,\n TFullSearchSchema,\n> {\n id: string\n routeId: TRouteId\n fullPath: TFullPath\n index: number\n pathname: string\n search:\n | { status: 'success'; value: TFullSearchSchema }\n | { status: 'error'; error: unknown }\n params:\n | { status: 'success'; value: TAllParams }\n | { status: 'error'; error: unknown }\n staticData: StaticDataRouteOption\n ssr?: boolean | 'data-only'\n}\n\nexport type MakePreValidationErrorHandlingRouteMatchUnion<\n TRouter extends AnyRouter = RegisteredRouter,\n TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>,\n> = TRoute extends any\n ? PreValidationErrorHandlingRouteMatch<\n TRoute['id'],\n TRoute['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema']\n >\n : never\n\nexport type MakeRouteMatchFromRoute<TRoute extends AnyRoute> = RouteMatch<\n TRoute['types']['id'],\n TRoute['types']['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema'],\n TRoute['types']['loaderData'],\n TRoute['types']['allContext'],\n TRoute['types']['loaderDeps']\n>\n\nexport type MakeRouteMatch<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TRouteId = RouteIds<TRouteTree>,\n TStrict extends boolean = true,\n> = RouteMatch<\n TRouteId,\n RouteById<TRouteTree, TRouteId>['types']['fullPath'],\n TStrict extends false\n ? AllParams<TRouteTree>\n : RouteById<TRouteTree, TRouteId>['types']['allParams'],\n TStrict extends false\n ? FullSearchSchema<TRouteTree>\n : RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'],\n TStrict extends false\n ? AllLoaderData<TRouteTree>\n : RouteById<TRouteTree, TRouteId>['types']['loaderData'],\n TStrict extends false\n ? AllContext<TRouteTree>\n : RouteById<TRouteTree, TRouteId>['types']['allContext'],\n RouteById<TRouteTree, TRouteId>['types']['loaderDeps']\n>\n\nexport type AnyRouteMatch = RouteMatch<any, any, any, any, any, any, any>\n\nexport type MakeRouteMatchUnion<\n TRouter extends AnyRouter = RegisteredRouter,\n TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>,\n> = TRoute extends any\n ? RouteMatch<\n TRoute['id'],\n TRoute['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema'],\n TRoute['types']['loaderData'],\n TRoute['types']['allContext'],\n TRoute['types']['loaderDeps']\n >\n : never\n\n/**\n * The `MatchRouteOptions` type is used to describe the options that can be used when matching a route.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#matchrouteoptions-type)\n */\nexport interface MatchRouteOptions {\n /**\n * If `true`, will match against pending location instead of the current location.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#pending-property)\n */\n pending?: boolean\n /**\n * If `true`, will match against the current location with case sensitivity.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#casesensitive-property)\n *\n * @deprecated Declare case sensitivity in the route definition instead, or globally for all routes using the `caseSensitive` option on the router.\n */\n caseSensitive?: boolean\n /**\n * If `true`, will match against the current location's search params using a deep inclusive check. e.g. `{ a: 1 }` will match for a current location of `{ a: 1, b: 2 }`.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#includesearch-property)\n */\n includeSearch?: boolean\n /**\n * If `true`, will match against the current location using a fuzzy match. e.g. `/posts` will match for a current location of `/posts/123`.\n *\n * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#fuzzy-property)\n */\n fuzzy?: boolean\n}\n"],"names":[],"mappings":";;AA2FO,MAAM,UAAU,CACrB,OACA,SAC8C;AAC9C,QAAM,QAAS,KAAgB,MAAM,GAAG;AACxC,MAAI;AACJ,MAAI,IAAI;AACR,MAAI,QAAa;AAEjB,UAAQ,OAAO,MAAM,GAAG,MAAM,QAAQ,SAAS,MAAM;AACnD,YAAQ,MAAM,IAAI;AAAA,EACpB;AAEA,SAAO,SAAS;AAClB;;"}
@@ -120,6 +120,8 @@ export interface MatchRouteOptions {
120
120
  * If `true`, will match against the current location with case sensitivity.
121
121
  *
122
122
  * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#casesensitive-property)
123
+ *
124
+ * @deprecated Declare case sensitivity in the route definition instead, or globally for all routes using the `caseSensitive` option on the router.
123
125
  */
124
126
  caseSensitive?: boolean;
125
127
  /**
@@ -8,7 +8,6 @@ const path = require("./path.cjs");
8
8
  const qss = require("./qss.cjs");
9
9
  const root = require("./root.cjs");
10
10
  const route = require("./route.cjs");
11
- const processRouteTree = require("./process-route-tree.cjs");
12
11
  const router = require("./router.cjs");
13
12
  const config = require("./config.cjs");
14
13
  const searchMiddleware = require("./searchMiddleware.cjs");
@@ -29,9 +28,6 @@ exports.cleanPath = path.cleanPath;
29
28
  exports.exactPathTest = path.exactPathTest;
30
29
  exports.interpolatePath = path.interpolatePath;
31
30
  exports.joinPaths = path.joinPaths;
32
- exports.matchByPath = path.matchByPath;
33
- exports.matchPathname = path.matchPathname;
34
- exports.parsePathname = path.parsePathname;
35
31
  exports.removeTrailingSlash = path.removeTrailingSlash;
36
32
  exports.resolvePath = path.resolvePath;
37
33
  exports.trimPath = path.trimPath;
@@ -43,7 +39,6 @@ exports.rootRouteId = root.rootRouteId;
43
39
  exports.BaseRootRoute = route.BaseRootRoute;
44
40
  exports.BaseRoute = route.BaseRoute;
45
41
  exports.BaseRouteApi = route.BaseRouteApi;
46
- exports.processRouteTree = processRouteTree.processRouteTree;
47
42
  exports.PathParamError = router.PathParamError;
48
43
  exports.RouterCore = router.RouterCore;
49
44
  exports.SearchParamError = router.SearchParamError;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -10,15 +10,12 @@ export type { ParsedLocation } from './location.cjs';
10
10
  export type { Manifest, RouterManagedTag } from './manifest.cjs';
11
11
  export { isMatch } from './Matches.cjs';
12
12
  export type { AnyMatchAndValue, FindValueByIndex, FindValueByKey, CreateMatchAndValue, NextMatchAndValue, IsMatchKeyOf, IsMatchPath, IsMatchResult, IsMatchParse, IsMatch, RouteMatch, RouteMatchExtensions, MakeRouteMatchUnion, MakeRouteMatch, AnyRouteMatch, MakeRouteMatchFromRoute, MatchRouteOptions, } from './Matches.cjs';
13
- export { joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, removeTrailingSlash, exactPathTest, resolvePath, parsePathname, interpolatePath, matchPathname, matchByPath, } from './path.cjs';
14
- export type { Segment } from './path.cjs';
13
+ export { joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, removeTrailingSlash, exactPathTest, resolvePath, interpolatePath, } from './path.cjs';
15
14
  export { encode, decode } from './qss.cjs';
16
15
  export { rootRouteId } from './root.cjs';
17
16
  export type { RootRouteId } from './root.cjs';
18
17
  export { BaseRoute, BaseRouteApi, BaseRootRoute } from './route.cjs';
19
18
  export type { AnyPathParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, SearchFilter, SearchMiddlewareContext, SearchMiddleware, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, InferAllParams, InferAllContext, MetaDescriptor, RouteLinkEntry, SearchValidator, AnySearchValidator, DefaultSearchValidator, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, ResolveParams, ParseParamsFn, StringifyParamsFn, ParamsOptions, UpdatableStaticRouteOption, ContextReturnType, ContextAsyncReturnType, ResolveRouteContext, ResolveLoaderData, RoutePrefix, TrimPath, TrimPathLeft, TrimPathRight, ResolveSearchSchemaFnInput, ResolveSearchSchemaInput, ResolveSearchSchemaFn, ResolveSearchSchema, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllContext, BeforeLoadContextParameter, RouteContextParameter, ResolveAllParamsFromParent, AnyRoute, Route, RouteTypes, FullSearchSchemaOption, RemountDepsOptions, MakeRemountDepsOptionsUnion, ResolveFullPath, AnyRouteWithContext, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, RouteContextFn, ContextOptions, RouteContextOptions, BeforeLoadContextOptions, RootRouteOptions, RootRouteOptionsExtensions, UpdatableRouteOptionsExtensions, RouteConstraints, RouteTypesById, RouteMask, RouteExtensions, RouteLazyFn, RouteAddChildrenFn, RouteAddFileChildrenFn, RouteAddFileTypesFn, ResolveOptionalParams, ResolveRequiredParams, RootRoute, FilebaseRouteOptionsInterface, } from './route.cjs';
20
- export { processRouteTree } from './process-route-tree.cjs';
21
- export type { ProcessRouteTreeResult } from './process-route-tree.cjs';
22
19
  export { defaultSerializeError, getLocationChangeInfo, RouterCore, lazyFn, SearchParamError, PathParamError, getInitialRouterState, getMatchedRoutes, trailingSlashOptions, } from './router.cjs';
23
20
  export type { ViewTransitionOptions, TrailingSlashOption, Register, AnyRouter, AnyRouterWithContext, RegisteredRouter, RouterState, BuildNextOptions, RouterListener, RouterEvent, ListenerFn, RouterEvents, MatchRoutesOpts, RouterOptionsExtensions, DefaultRemountDepsFn, PreloadRouteFn, MatchRouteFn, RouterContextOptions, RouterOptions, RouterConstructorOptions, UpdateFn, ParseLocationFn, InvalidateFn, ControllablePromise, InjectedHtmlEntry, EmitFn, LoadFn, GetMatchFn, SubscribeFn, UpdateMatchFn, CommitLocationFn, GetMatchRoutesFn, MatchRoutesFn, StartTransitionFn, LoadRouteChunkFn, ClearCacheFn, CreateRouterFn, SSROption, } from './router.cjs';
24
21
  export * from './config.cjs';
@@ -55,6 +55,11 @@ function createLRUCache(max) {
55
55
  if (!oldest) oldest = entry;
56
56
  cache.set(key, entry);
57
57
  }
58
+ },
59
+ clear() {
60
+ cache.clear();
61
+ oldest = void 0;
62
+ newest = void 0;
58
63
  }
59
64
  };
60
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lru-cache.cjs","sources":["../../src/lru-cache.ts"],"sourcesContent":["export type LRUCache<TKey, TValue> = {\n get: (key: TKey) => TValue | undefined\n set: (key: TKey, value: TValue) => void\n}\n\nexport function createLRUCache<TKey, TValue>(\n max: number,\n): LRUCache<TKey, TValue> {\n type Node = { prev?: Node; next?: Node; key: TKey; value: TValue }\n const cache = new Map<TKey, Node>()\n let oldest: Node | undefined\n let newest: Node | undefined\n\n const touch = (entry: Node) => {\n if (!entry.next) return\n if (!entry.prev) {\n entry.next.prev = undefined\n oldest = entry.next\n entry.next = undefined\n if (newest) {\n entry.prev = newest\n newest.next = entry\n }\n } else {\n entry.prev.next = entry.next\n entry.next.prev = entry.prev\n entry.next = undefined\n if (newest) {\n newest.next = entry\n entry.prev = newest\n }\n }\n newest = entry\n }\n\n return {\n get(key) {\n const entry = cache.get(key)\n if (!entry) return undefined\n touch(entry)\n return entry.value\n },\n set(key, value) {\n if (cache.size >= max && oldest) {\n const toDelete = oldest\n cache.delete(toDelete.key)\n if (toDelete.next) {\n oldest = toDelete.next\n toDelete.next.prev = undefined\n }\n if (toDelete === newest) {\n newest = undefined\n }\n }\n const existing = cache.get(key)\n if (existing) {\n existing.value = value\n touch(existing)\n } else {\n const entry: Node = { key, value, prev: newest }\n if (newest) newest.next = entry\n newest = entry\n if (!oldest) oldest = entry\n cache.set(key, entry)\n }\n },\n }\n}\n"],"names":[],"mappings":";;AAKO,SAAS,eACd,KACwB;AAExB,QAAM,4BAAY,IAAA;AAClB,MAAI;AACJ,MAAI;AAEJ,QAAM,QAAQ,CAAC,UAAgB;AAC7B,QAAI,CAAC,MAAM,KAAM;AACjB,QAAI,CAAC,MAAM,MAAM;AACf,YAAM,KAAK,OAAO;AAClB,eAAS,MAAM;AACf,YAAM,OAAO;AACb,UAAI,QAAQ;AACV,cAAM,OAAO;AACb,eAAO,OAAO;AAAA,MAChB;AAAA,IACF,OAAO;AACL,YAAM,KAAK,OAAO,MAAM;AACxB,YAAM,KAAK,OAAO,MAAM;AACxB,YAAM,OAAO;AACb,UAAI,QAAQ;AACV,eAAO,OAAO;AACd,cAAM,OAAO;AAAA,MACf;AAAA,IACF;AACA,aAAS;AAAA,EACX;AAEA,SAAO;AAAA,IACL,IAAI,KAAK;AACP,YAAM,QAAQ,MAAM,IAAI,GAAG;AAC3B,UAAI,CAAC,MAAO,QAAO;AACnB,YAAM,KAAK;AACX,aAAO,MAAM;AAAA,IACf;AAAA,IACA,IAAI,KAAK,OAAO;AACd,UAAI,MAAM,QAAQ,OAAO,QAAQ;AAC/B,cAAM,WAAW;AACjB,cAAM,OAAO,SAAS,GAAG;AACzB,YAAI,SAAS,MAAM;AACjB,mBAAS,SAAS;AAClB,mBAAS,KAAK,OAAO;AAAA,QACvB;AACA,YAAI,aAAa,QAAQ;AACvB,mBAAS;AAAA,QACX;AAAA,MACF;AACA,YAAM,WAAW,MAAM,IAAI,GAAG;AAC9B,UAAI,UAAU;AACZ,iBAAS,QAAQ;AACjB,cAAM,QAAQ;AAAA,MAChB,OAAO;AACL,cAAM,QAAc,EAAE,KAAK,OAAO,MAAM,OAAA;AACxC,YAAI,eAAe,OAAO;AAC1B,iBAAS;AACT,YAAI,CAAC,OAAQ,UAAS;AACtB,cAAM,IAAI,KAAK,KAAK;AAAA,MACtB;AAAA,IACF;AAAA,EAAA;AAEJ;;"}
1
+ {"version":3,"file":"lru-cache.cjs","sources":["../../src/lru-cache.ts"],"sourcesContent":["export type LRUCache<TKey, TValue> = {\n get: (key: TKey) => TValue | undefined\n set: (key: TKey, value: TValue) => void\n clear: () => void\n}\n\nexport function createLRUCache<TKey, TValue>(\n max: number,\n): LRUCache<TKey, TValue> {\n type Node = { prev?: Node; next?: Node; key: TKey; value: TValue }\n const cache = new Map<TKey, Node>()\n let oldest: Node | undefined\n let newest: Node | undefined\n\n const touch = (entry: Node) => {\n if (!entry.next) return\n if (!entry.prev) {\n entry.next.prev = undefined\n oldest = entry.next\n entry.next = undefined\n if (newest) {\n entry.prev = newest\n newest.next = entry\n }\n } else {\n entry.prev.next = entry.next\n entry.next.prev = entry.prev\n entry.next = undefined\n if (newest) {\n newest.next = entry\n entry.prev = newest\n }\n }\n newest = entry\n }\n\n return {\n get(key) {\n const entry = cache.get(key)\n if (!entry) return undefined\n touch(entry)\n return entry.value\n },\n set(key, value) {\n if (cache.size >= max && oldest) {\n const toDelete = oldest\n cache.delete(toDelete.key)\n if (toDelete.next) {\n oldest = toDelete.next\n toDelete.next.prev = undefined\n }\n if (toDelete === newest) {\n newest = undefined\n }\n }\n const existing = cache.get(key)\n if (existing) {\n existing.value = value\n touch(existing)\n } else {\n const entry: Node = { key, value, prev: newest }\n if (newest) newest.next = entry\n newest = entry\n if (!oldest) oldest = entry\n cache.set(key, entry)\n }\n },\n clear() {\n cache.clear()\n oldest = undefined\n newest = undefined\n },\n }\n}\n"],"names":[],"mappings":";;AAMO,SAAS,eACd,KACwB;AAExB,QAAM,4BAAY,IAAA;AAClB,MAAI;AACJ,MAAI;AAEJ,QAAM,QAAQ,CAAC,UAAgB;AAC7B,QAAI,CAAC,MAAM,KAAM;AACjB,QAAI,CAAC,MAAM,MAAM;AACf,YAAM,KAAK,OAAO;AAClB,eAAS,MAAM;AACf,YAAM,OAAO;AACb,UAAI,QAAQ;AACV,cAAM,OAAO;AACb,eAAO,OAAO;AAAA,MAChB;AAAA,IACF,OAAO;AACL,YAAM,KAAK,OAAO,MAAM;AACxB,YAAM,KAAK,OAAO,MAAM;AACxB,YAAM,OAAO;AACb,UAAI,QAAQ;AACV,eAAO,OAAO;AACd,cAAM,OAAO;AAAA,MACf;AAAA,IACF;AACA,aAAS;AAAA,EACX;AAEA,SAAO;AAAA,IACL,IAAI,KAAK;AACP,YAAM,QAAQ,MAAM,IAAI,GAAG;AAC3B,UAAI,CAAC,MAAO,QAAO;AACnB,YAAM,KAAK;AACX,aAAO,MAAM;AAAA,IACf;AAAA,IACA,IAAI,KAAK,OAAO;AACd,UAAI,MAAM,QAAQ,OAAO,QAAQ;AAC/B,cAAM,WAAW;AACjB,cAAM,OAAO,SAAS,GAAG;AACzB,YAAI,SAAS,MAAM;AACjB,mBAAS,SAAS;AAClB,mBAAS,KAAK,OAAO;AAAA,QACvB;AACA,YAAI,aAAa,QAAQ;AACvB,mBAAS;AAAA,QACX;AAAA,MACF;AACA,YAAM,WAAW,MAAM,IAAI,GAAG;AAC9B,UAAI,UAAU;AACZ,iBAAS,QAAQ;AACjB,cAAM,QAAQ;AAAA,MAChB,OAAO;AACL,cAAM,QAAc,EAAE,KAAK,OAAO,MAAM,OAAA;AACxC,YAAI,eAAe,OAAO;AAC1B,iBAAS;AACT,YAAI,CAAC,OAAQ,UAAS;AACtB,cAAM,IAAI,KAAK,KAAK;AAAA,MACtB;AAAA,IACF;AAAA,IACA,QAAQ;AACN,YAAM,MAAA;AACN,eAAS;AACT,eAAS;AAAA,IACX;AAAA,EAAA;AAEJ;;"}
@@ -1,5 +1,6 @@
1
1
  export type LRUCache<TKey, TValue> = {
2
2
  get: (key: TKey) => TValue | undefined;
3
3
  set: (key: TKey, value: TValue) => void;
4
+ clear: () => void;
4
5
  };
5
6
  export declare function createLRUCache<TKey, TValue>(max: number): LRUCache<TKey, TValue>;