@tanstack/router-core 0.0.1-beta.3 → 0.0.1-beta.31
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/build/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -2
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/build/cjs/{packages/router-core/src/index.js → index.js} +23 -7
- package/build/cjs/{packages/router-core/src/index.js.map → index.js.map} +1 -1
- package/build/cjs/{packages/router-core/src/path.js → path.js} +7 -34
- package/build/cjs/path.js.map +1 -0
- package/build/cjs/{packages/router-core/src/qss.js → qss.js} +9 -13
- package/build/cjs/qss.js.map +1 -0
- package/build/cjs/{packages/router-core/src/route.js → route.js} +15 -37
- package/build/cjs/route.js.map +1 -0
- package/build/cjs/{packages/router-core/src/routeConfig.js → routeConfig.js} +13 -12
- package/build/cjs/routeConfig.js.map +1 -0
- package/build/cjs/routeMatch.js +200 -0
- package/build/cjs/routeMatch.js.map +1 -0
- package/build/cjs/{packages/router-core/src/router.js → router.js} +257 -221
- package/build/cjs/router.js.map +1 -0
- package/build/cjs/{packages/router-core/src/searchParams.js → searchParams.js} +7 -10
- package/build/cjs/searchParams.js.map +1 -0
- package/build/cjs/{packages/router-core/src/utils.js → utils.js} +17 -30
- package/build/cjs/utils.js.map +1 -0
- package/build/esm/index.js +395 -1322
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +59 -49
- package/build/stats-react.json +161 -168
- package/build/types/index.d.ts +247 -227
- package/build/umd/index.development.js +385 -495
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +3 -2
- package/src/frameworks.ts +2 -2
- package/src/index.ts +0 -1
- package/src/link.ts +66 -31
- package/src/path.ts +2 -6
- package/src/qss.ts +1 -0
- package/src/route.ts +25 -33
- package/src/routeConfig.ts +100 -77
- package/src/routeInfo.ts +26 -8
- package/src/routeMatch.ts +100 -160
- package/src/router.ts +363 -141
- package/src/utils.ts +14 -7
- package/build/cjs/node_modules/@babel/runtime/helpers/esm/extends.js +0 -33
- package/build/cjs/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
- package/build/cjs/node_modules/history/index.js +0 -815
- package/build/cjs/node_modules/history/index.js.map +0 -1
- package/build/cjs/node_modules/tiny-invariant/dist/esm/tiny-invariant.js +0 -30
- package/build/cjs/node_modules/tiny-invariant/dist/esm/tiny-invariant.js.map +0 -1
- package/build/cjs/packages/router-core/src/path.js.map +0 -1
- package/build/cjs/packages/router-core/src/qss.js.map +0 -1
- package/build/cjs/packages/router-core/src/route.js.map +0 -1
- package/build/cjs/packages/router-core/src/routeConfig.js.map +0 -1
- package/build/cjs/packages/router-core/src/routeMatch.js +0 -266
- package/build/cjs/packages/router-core/src/routeMatch.js.map +0 -1
- package/build/cjs/packages/router-core/src/router.js.map +0 -1
- package/build/cjs/packages/router-core/src/searchParams.js.map +0 -1
- package/build/cjs/packages/router-core/src/utils.js.map +0 -1
package/src/utils.ts
CHANGED
|
@@ -24,11 +24,11 @@ export type Expand<T> = T extends object
|
|
|
24
24
|
: never
|
|
25
25
|
: T
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
export type UnionToIntersection<U> = (
|
|
28
|
+
U extends any ? (k: U) => void : never
|
|
29
|
+
) extends (k: infer I) => any
|
|
30
|
+
? I
|
|
31
|
+
: never
|
|
32
32
|
|
|
33
33
|
export type Values<O> = O[ValueKeys<O>]
|
|
34
34
|
export type ValueKeys<O> = Extract<keyof O, PropertyKey>
|
|
@@ -40,9 +40,9 @@ export type DeepAwaited<T> = T extends Promise<infer A>
|
|
|
40
40
|
: T
|
|
41
41
|
|
|
42
42
|
export type PathParamMask<TRoutePath extends string> =
|
|
43
|
-
TRoutePath extends `${infer L}
|
|
43
|
+
TRoutePath extends `${infer L}/$${infer C}/${infer R}`
|
|
44
44
|
? PathParamMask<`${L}/${string}/${R}`>
|
|
45
|
-
: TRoutePath extends `${infer L}
|
|
45
|
+
: TRoutePath extends `${infer L}/$${infer C}`
|
|
46
46
|
? PathParamMask<`${L}/${string}`>
|
|
47
47
|
: TRoutePath
|
|
48
48
|
|
|
@@ -155,3 +155,10 @@ export function functionalUpdate<TResult>(
|
|
|
155
155
|
|
|
156
156
|
return updater
|
|
157
157
|
}
|
|
158
|
+
|
|
159
|
+
export function pick<T, K extends keyof T>(parent: T, keys: K[]): Pick<T, K> {
|
|
160
|
+
return keys.reduce((obj: any, key: K) => {
|
|
161
|
+
obj[key] = parent[key]
|
|
162
|
+
return obj
|
|
163
|
+
}, {} as any)
|
|
164
|
+
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* router-core
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) TanStack
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @license MIT
|
|
10
|
-
*/
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
|
-
|
|
15
|
-
function _extends() {
|
|
16
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
17
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
18
|
-
var source = arguments[i];
|
|
19
|
-
|
|
20
|
-
for (var key in source) {
|
|
21
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
22
|
-
target[key] = source[key];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return target;
|
|
28
|
-
};
|
|
29
|
-
return _extends.apply(this, arguments);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
exports["default"] = _extends;
|
|
33
|
-
//# sourceMappingURL=extends.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extends.js","sources":["../../../../../../../../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}"],"names":[],"mappings":";;;;;;;;;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC;AACA,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;AAC/D,UAAU,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpC,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzC;;;;"}
|