@tanstack/router-core 0.0.1-alpha.0

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 (36) hide show
  1. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +33 -0
  2. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  3. package/build/cjs/packages/location-core/src/index.js +1313 -0
  4. package/build/cjs/packages/location-core/src/index.js.map +1 -0
  5. package/build/cjs/packages/location-core/src/qss.js +70 -0
  6. package/build/cjs/packages/location-core/src/qss.js.map +1 -0
  7. package/build/cjs/packages/router-core/src/createRoutes.js +106 -0
  8. package/build/cjs/packages/router-core/src/createRoutes.js.map +1 -0
  9. package/build/cjs/packages/router-core/src/createRoutes.test.js +160 -0
  10. package/build/cjs/packages/router-core/src/createRoutes.test.js.map +1 -0
  11. package/build/cjs/packages/router-core/src/index.js +1444 -0
  12. package/build/cjs/packages/router-core/src/index.js.map +1 -0
  13. package/build/cjs/packages/router-core/src/qss.js +70 -0
  14. package/build/cjs/packages/router-core/src/qss.js.map +1 -0
  15. package/build/esm/index.js +2297 -0
  16. package/build/esm/index.js.map +1 -0
  17. package/build/stats-html.html +4034 -0
  18. package/build/stats-react.json +157 -0
  19. package/build/types/createRoutes.d.ts +10 -0
  20. package/build/types/createRoutes.test.d.ts +1 -0
  21. package/build/types/index.d.ts +517 -0
  22. package/build/types/qss.d.ts +2 -0
  23. package/build/types/react-router/src/createRoutes.test.d.ts +0 -0
  24. package/build/types/react-router/src/index.d.ts +59 -0
  25. package/build/types/router-core/src/createRoutes.test.d.ts +1 -0
  26. package/build/types/router-core/src/index.d.ts +504 -0
  27. package/build/types/router-core/src/qss.d.ts +2 -0
  28. package/build/umd/index.development.js +2322 -0
  29. package/build/umd/index.development.js.map +1 -0
  30. package/build/umd/index.production.js +12 -0
  31. package/build/umd/index.production.js.map +1 -0
  32. package/package.json +48 -0
  33. package/src/createRoutes.test.ts +318 -0
  34. package/src/index.ts +2974 -0
  35. package/src/package.json +48 -0
  36. package/src/qss.ts +53 -0
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@tanstack/router-core",
3
+ "author": "Tanner Linsley",
4
+ "version": "0.0.1-alpha.0",
5
+ "license": "MIT",
6
+ "repository": "tanstack/router",
7
+ "homepage": "https://tanstack.com/router",
8
+ "description": "",
9
+ "publishConfig": {
10
+ "registry": "https://registry.npmjs.org/"
11
+ },
12
+ "keywords": [
13
+ "react",
14
+ "location",
15
+ "@tanstack/react-router",
16
+ "router",
17
+ "routing",
18
+ "async",
19
+ "async router",
20
+ "typescript"
21
+ ],
22
+ "funding": {
23
+ "type": "github",
24
+ "url": "https://github.com/sponsors/tannerlinsley"
25
+ },
26
+ "module": "build/esm/index.js",
27
+ "main": "build/cjs/index.js",
28
+ "browser": "build/umd/index.production.js",
29
+ "types": "build/types/index.d.ts",
30
+ "engines": {
31
+ "node": ">=12"
32
+ },
33
+ "files": [
34
+ "build/**",
35
+ "src"
36
+ ],
37
+ "peerDependencies": {
38
+ "react": ">=16",
39
+ "react-dom": ">=16"
40
+ },
41
+ "dependencies": {
42
+ "@babel/runtime": "^7.16.7",
43
+ "history": "^5.2.0"
44
+ },
45
+ "devDependencies": {
46
+ "babel-plugin-transform-async-to-promises": "^0.8.18"
47
+ }
48
+ }
package/src/qss.ts ADDED
@@ -0,0 +1,53 @@
1
+ // @ts-nocheck
2
+
3
+ // We're inlining qss here for compression's sake, but we've included it as a hard dependency for the MIT license it requires.
4
+
5
+ export function encode(obj, pfx?: string) {
6
+ var k,
7
+ i,
8
+ tmp,
9
+ str = ''
10
+
11
+ for (k in obj) {
12
+ if ((tmp = obj[k]) !== void 0) {
13
+ if (Array.isArray(tmp)) {
14
+ for (i = 0; i < tmp.length; i++) {
15
+ str && (str += '&')
16
+ str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i])
17
+ }
18
+ } else {
19
+ str && (str += '&')
20
+ str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp)
21
+ }
22
+ }
23
+ }
24
+
25
+ return (pfx || '') + str
26
+ }
27
+
28
+ function toValue(mix) {
29
+ if (!mix) return ''
30
+ var str = decodeURIComponent(mix)
31
+ if (str === 'false') return false
32
+ if (str === 'true') return true
33
+ return +str * 0 === 0 ? +str : str
34
+ }
35
+
36
+ export function decode(str) {
37
+ var tmp,
38
+ k,
39
+ out = {},
40
+ arr = str.split('&')
41
+
42
+ while ((tmp = arr.shift())) {
43
+ tmp = tmp.split('=')
44
+ k = tmp.shift()
45
+ if (out[k] !== void 0) {
46
+ out[k] = [].concat(out[k], toValue(tmp.shift()))
47
+ } else {
48
+ out[k] = toValue(tmp.shift())
49
+ }
50
+ }
51
+
52
+ return out
53
+ }