@tanstack/router-core 0.0.1-beta.3 → 0.0.1-beta.30

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 (56) hide show
  1. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -2
  2. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  3. package/build/cjs/{packages/router-core/src/index.js → index.js} +23 -7
  4. package/build/cjs/{packages/router-core/src/index.js.map → index.js.map} +1 -1
  5. package/build/cjs/{packages/router-core/src/path.js → path.js} +7 -34
  6. package/build/cjs/path.js.map +1 -0
  7. package/build/cjs/{packages/router-core/src/qss.js → qss.js} +9 -13
  8. package/build/cjs/qss.js.map +1 -0
  9. package/build/cjs/{packages/router-core/src/route.js → route.js} +15 -37
  10. package/build/cjs/route.js.map +1 -0
  11. package/build/cjs/{packages/router-core/src/routeConfig.js → routeConfig.js} +13 -12
  12. package/build/cjs/routeConfig.js.map +1 -0
  13. package/build/cjs/routeMatch.js +200 -0
  14. package/build/cjs/routeMatch.js.map +1 -0
  15. package/build/cjs/{packages/router-core/src/router.js → router.js} +246 -208
  16. package/build/cjs/router.js.map +1 -0
  17. package/build/cjs/{packages/router-core/src/searchParams.js → searchParams.js} +7 -10
  18. package/build/cjs/searchParams.js.map +1 -0
  19. package/build/cjs/{packages/router-core/src/utils.js → utils.js} +17 -30
  20. package/build/cjs/utils.js.map +1 -0
  21. package/build/esm/index.js +382 -1307
  22. package/build/esm/index.js.map +1 -1
  23. package/build/stats-html.html +59 -49
  24. package/build/stats-react.json +161 -168
  25. package/build/types/index.d.ts +228 -206
  26. package/build/umd/index.development.js +373 -481
  27. package/build/umd/index.development.js.map +1 -1
  28. package/build/umd/index.production.js +1 -1
  29. package/build/umd/index.production.js.map +1 -1
  30. package/package.json +3 -2
  31. package/src/frameworks.ts +2 -2
  32. package/src/index.ts +0 -1
  33. package/src/link.ts +8 -5
  34. package/src/path.ts +2 -6
  35. package/src/qss.ts +1 -0
  36. package/src/route.ts +24 -32
  37. package/src/routeConfig.ts +100 -77
  38. package/src/routeInfo.ts +22 -7
  39. package/src/routeMatch.ts +95 -157
  40. package/src/router.ts +346 -122
  41. package/src/utils.ts +14 -7
  42. package/build/cjs/node_modules/@babel/runtime/helpers/esm/extends.js +0 -33
  43. package/build/cjs/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
  44. package/build/cjs/node_modules/history/index.js +0 -815
  45. package/build/cjs/node_modules/history/index.js.map +0 -1
  46. package/build/cjs/node_modules/tiny-invariant/dist/esm/tiny-invariant.js +0 -30
  47. package/build/cjs/node_modules/tiny-invariant/dist/esm/tiny-invariant.js.map +0 -1
  48. package/build/cjs/packages/router-core/src/path.js.map +0 -1
  49. package/build/cjs/packages/router-core/src/qss.js.map +0 -1
  50. package/build/cjs/packages/router-core/src/route.js.map +0 -1
  51. package/build/cjs/packages/router-core/src/routeConfig.js.map +0 -1
  52. package/build/cjs/packages/router-core/src/routeMatch.js +0 -266
  53. package/build/cjs/packages/router-core/src/routeMatch.js.map +0 -1
  54. package/build/cjs/packages/router-core/src/router.js.map +0 -1
  55. package/build/cjs/packages/router-core/src/searchParams.js.map +0 -1
  56. 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
- // type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
28
- // k: infer I,
29
- // ) => any
30
- // ? I
31
- // : never
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}/:${infer C}/${infer R}`
43
+ TRoutePath extends `${infer L}/$${infer C}/${infer R}`
44
44
  ? PathParamMask<`${L}/${string}/${R}`>
45
- : TRoutePath extends `${infer L}/:${infer C}`
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;;;;"}