@tanstack/router
Advanced tools
Comparing version 0.0.1-beta.139 to 0.0.1-beta.140
@@ -44,4 +44,3 @@ /** | ||
if (str === 'true') return true; | ||
if (str.charAt(0) === '0') return str; | ||
return +str * 0 === 0 ? +str : str; | ||
return +str * 0 === 0 && +str + '' === str ? +str : str; | ||
} | ||
@@ -48,0 +47,0 @@ function decode(str) { |
@@ -14,7 +14,7 @@ { | ||
"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js", | ||
"uid": "4f60-47" | ||
"uid": "8aaa-47" | ||
}, | ||
{ | ||
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js", | ||
"uid": "4f60-49" | ||
"uid": "8aaa-49" | ||
} | ||
@@ -30,35 +30,35 @@ ] | ||
{ | ||
"uid": "4f60-51", | ||
"uid": "8aaa-51", | ||
"name": "history.ts" | ||
}, | ||
{ | ||
"uid": "4f60-53", | ||
"uid": "8aaa-53", | ||
"name": "utils.ts" | ||
}, | ||
{ | ||
"uid": "4f60-55", | ||
"uid": "8aaa-55", | ||
"name": "path.ts" | ||
}, | ||
{ | ||
"uid": "4f60-57", | ||
"uid": "8aaa-57", | ||
"name": "qss.ts" | ||
}, | ||
{ | ||
"uid": "4f60-65", | ||
"uid": "8aaa-65", | ||
"name": "react.tsx" | ||
}, | ||
{ | ||
"uid": "4f60-67", | ||
"uid": "8aaa-67", | ||
"name": "route.ts" | ||
}, | ||
{ | ||
"uid": "4f60-69", | ||
"uid": "8aaa-69", | ||
"name": "searchParams.ts" | ||
}, | ||
{ | ||
"uid": "4f60-71", | ||
"uid": "8aaa-71", | ||
"name": "router.ts" | ||
}, | ||
{ | ||
"uid": "4f60-73", | ||
"uid": "8aaa-73", | ||
"name": "index.ts" | ||
@@ -70,7 +70,7 @@ } | ||
"name": "store/build/esm/index.js", | ||
"uid": "4f60-61" | ||
"uid": "8aaa-61" | ||
}, | ||
{ | ||
"name": "react-store/build/esm/index.js", | ||
"uid": "4f60-63" | ||
"uid": "8aaa-63" | ||
} | ||
@@ -80,3 +80,3 @@ ] | ||
{ | ||
"uid": "4f60-59", | ||
"uid": "8aaa-59", | ||
"name": "\u0000rollupPluginBabelHelpers.js" | ||
@@ -90,92 +90,92 @@ } | ||
"nodeParts": { | ||
"4f60-47": { | ||
"8aaa-47": { | ||
"renderedLength": 199, | ||
"gzipLength": 134, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-46" | ||
"mainUid": "8aaa-46" | ||
}, | ||
"4f60-49": { | ||
"8aaa-49": { | ||
"renderedLength": 48, | ||
"gzipLength": 65, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-48" | ||
"mainUid": "8aaa-48" | ||
}, | ||
"4f60-51": { | ||
"8aaa-51": { | ||
"renderedLength": 6378, | ||
"gzipLength": 1522, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-50" | ||
"mainUid": "8aaa-50" | ||
}, | ||
"4f60-53": { | ||
"8aaa-53": { | ||
"renderedLength": 2821, | ||
"gzipLength": 990, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-52" | ||
"mainUid": "8aaa-52" | ||
}, | ||
"4f60-55": { | ||
"8aaa-55": { | ||
"renderedLength": 6028, | ||
"gzipLength": 1423, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-54" | ||
"mainUid": "8aaa-54" | ||
}, | ||
"4f60-57": { | ||
"renderedLength": 1395, | ||
"gzipLength": 558, | ||
"8aaa-57": { | ||
"renderedLength": 1371, | ||
"gzipLength": 552, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-56" | ||
"mainUid": "8aaa-56" | ||
}, | ||
"4f60-59": { | ||
"8aaa-59": { | ||
"renderedLength": 457, | ||
"gzipLength": 241, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-58" | ||
"mainUid": "8aaa-58" | ||
}, | ||
"4f60-61": { | ||
"8aaa-61": { | ||
"renderedLength": 1969, | ||
"gzipLength": 653, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-60" | ||
"mainUid": "8aaa-60" | ||
}, | ||
"4f60-63": { | ||
"8aaa-63": { | ||
"renderedLength": 1070, | ||
"gzipLength": 485, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-62" | ||
"mainUid": "8aaa-62" | ||
}, | ||
"4f60-65": { | ||
"8aaa-65": { | ||
"renderedLength": 16689, | ||
"gzipLength": 3680, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-64" | ||
"mainUid": "8aaa-64" | ||
}, | ||
"4f60-67": { | ||
"8aaa-67": { | ||
"renderedLength": 4568, | ||
"gzipLength": 1127, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-66" | ||
"mainUid": "8aaa-66" | ||
}, | ||
"4f60-69": { | ||
"8aaa-69": { | ||
"renderedLength": 1387, | ||
"gzipLength": 483, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-68" | ||
"mainUid": "8aaa-68" | ||
}, | ||
"4f60-71": { | ||
"8aaa-71": { | ||
"renderedLength": 34332, | ||
"gzipLength": 7709, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-70" | ||
"mainUid": "8aaa-70" | ||
}, | ||
"4f60-73": { | ||
"8aaa-73": { | ||
"renderedLength": 0, | ||
"gzipLength": 0, | ||
"brotliLength": 0, | ||
"mainUid": "4f60-72" | ||
"mainUid": "8aaa-72" | ||
} | ||
}, | ||
"nodeMetas": { | ||
"4f60-46": { | ||
"8aaa-46": { | ||
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js", | ||
"moduleParts": { | ||
"index.production.js": "4f60-47" | ||
"index.production.js": "8aaa-47" | ||
}, | ||
@@ -185,19 +185,19 @@ "imported": [], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
}, | ||
{ | ||
"uid": "4f60-66" | ||
"uid": "8aaa-66" | ||
}, | ||
{ | ||
"uid": "4f60-70" | ||
"uid": "8aaa-70" | ||
}, | ||
{ | ||
"uid": "4f60-64" | ||
"uid": "8aaa-64" | ||
} | ||
] | ||
}, | ||
"4f60-48": { | ||
"8aaa-48": { | ||
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js", | ||
"moduleParts": { | ||
"index.production.js": "4f60-49" | ||
"index.production.js": "8aaa-49" | ||
}, | ||
@@ -207,13 +207,13 @@ "imported": [], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
}, | ||
{ | ||
"uid": "4f60-64" | ||
"uid": "8aaa-64" | ||
} | ||
] | ||
}, | ||
"4f60-50": { | ||
"8aaa-50": { | ||
"id": "/packages/router/src/history.ts", | ||
"moduleParts": { | ||
"index.production.js": "4f60-51" | ||
"index.production.js": "8aaa-51" | ||
}, | ||
@@ -223,13 +223,13 @@ "imported": [], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
}, | ||
{ | ||
"uid": "4f60-70" | ||
"uid": "8aaa-70" | ||
} | ||
] | ||
}, | ||
"4f60-52": { | ||
"8aaa-52": { | ||
"id": "/packages/router/src/utils.ts", | ||
"moduleParts": { | ||
"index.production.js": "4f60-53" | ||
"index.production.js": "8aaa-53" | ||
}, | ||
@@ -239,23 +239,23 @@ "imported": [], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
}, | ||
{ | ||
"uid": "4f60-54" | ||
"uid": "8aaa-54" | ||
}, | ||
{ | ||
"uid": "4f60-70" | ||
"uid": "8aaa-70" | ||
}, | ||
{ | ||
"uid": "4f60-64" | ||
"uid": "8aaa-64" | ||
} | ||
] | ||
}, | ||
"4f60-54": { | ||
"8aaa-54": { | ||
"id": "/packages/router/src/path.ts", | ||
"moduleParts": { | ||
"index.production.js": "4f60-55" | ||
"index.production.js": "8aaa-55" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "4f60-52" | ||
"uid": "8aaa-52" | ||
} | ||
@@ -265,16 +265,16 @@ ], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
}, | ||
{ | ||
"uid": "4f60-66" | ||
"uid": "8aaa-66" | ||
}, | ||
{ | ||
"uid": "4f60-70" | ||
"uid": "8aaa-70" | ||
} | ||
] | ||
}, | ||
"4f60-56": { | ||
"8aaa-56": { | ||
"id": "/packages/router/src/qss.ts", | ||
"moduleParts": { | ||
"index.production.js": "4f60-57" | ||
"index.production.js": "8aaa-57" | ||
}, | ||
@@ -284,13 +284,13 @@ "imported": [], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
}, | ||
{ | ||
"uid": "4f60-68" | ||
"uid": "8aaa-68" | ||
} | ||
] | ||
}, | ||
"4f60-58": { | ||
"8aaa-58": { | ||
"id": "\u0000rollupPluginBabelHelpers.js", | ||
"moduleParts": { | ||
"index.production.js": "4f60-59" | ||
"index.production.js": "8aaa-59" | ||
}, | ||
@@ -300,10 +300,10 @@ "imported": [], | ||
{ | ||
"uid": "4f60-64" | ||
"uid": "8aaa-64" | ||
} | ||
] | ||
}, | ||
"4f60-60": { | ||
"8aaa-60": { | ||
"id": "/packages/store/build/esm/index.js", | ||
"moduleParts": { | ||
"index.production.js": "4f60-61" | ||
"index.production.js": "8aaa-61" | ||
}, | ||
@@ -313,17 +313,17 @@ "imported": [], | ||
{ | ||
"uid": "4f60-62" | ||
"uid": "8aaa-62" | ||
} | ||
] | ||
}, | ||
"4f60-62": { | ||
"8aaa-62": { | ||
"id": "/packages/react-store/build/esm/index.js", | ||
"moduleParts": { | ||
"index.production.js": "4f60-63" | ||
"index.production.js": "8aaa-63" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "4f60-77" | ||
"uid": "8aaa-77" | ||
}, | ||
{ | ||
"uid": "4f60-60" | ||
"uid": "8aaa-60" | ||
} | ||
@@ -333,32 +333,32 @@ ], | ||
{ | ||
"uid": "4f60-70" | ||
"uid": "8aaa-70" | ||
}, | ||
{ | ||
"uid": "4f60-64" | ||
"uid": "8aaa-64" | ||
} | ||
] | ||
}, | ||
"4f60-64": { | ||
"8aaa-64": { | ||
"id": "/packages/router/src/react.tsx", | ||
"moduleParts": { | ||
"index.production.js": "4f60-65" | ||
"index.production.js": "8aaa-65" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "4f60-58" | ||
"uid": "8aaa-58" | ||
}, | ||
{ | ||
"uid": "4f60-76" | ||
"uid": "8aaa-76" | ||
}, | ||
{ | ||
"uid": "4f60-62" | ||
"uid": "8aaa-62" | ||
}, | ||
{ | ||
"uid": "4f60-46" | ||
"uid": "8aaa-46" | ||
}, | ||
{ | ||
"uid": "4f60-48" | ||
"uid": "8aaa-48" | ||
}, | ||
{ | ||
"uid": "4f60-52" | ||
"uid": "8aaa-52" | ||
} | ||
@@ -368,23 +368,23 @@ ], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
}, | ||
{ | ||
"uid": "4f60-66" | ||
"uid": "8aaa-66" | ||
} | ||
] | ||
}, | ||
"4f60-66": { | ||
"8aaa-66": { | ||
"id": "/packages/router/src/route.ts", | ||
"moduleParts": { | ||
"index.production.js": "4f60-67" | ||
"index.production.js": "8aaa-67" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "4f60-46" | ||
"uid": "8aaa-46" | ||
}, | ||
{ | ||
"uid": "4f60-54" | ||
"uid": "8aaa-54" | ||
}, | ||
{ | ||
"uid": "4f60-64" | ||
"uid": "8aaa-64" | ||
} | ||
@@ -394,14 +394,14 @@ ], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
} | ||
] | ||
}, | ||
"4f60-68": { | ||
"8aaa-68": { | ||
"id": "/packages/router/src/searchParams.ts", | ||
"moduleParts": { | ||
"index.production.js": "4f60-69" | ||
"index.production.js": "8aaa-69" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "4f60-56" | ||
"uid": "8aaa-56" | ||
} | ||
@@ -411,32 +411,32 @@ ], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
}, | ||
{ | ||
"uid": "4f60-70" | ||
"uid": "8aaa-70" | ||
} | ||
] | ||
}, | ||
"4f60-70": { | ||
"8aaa-70": { | ||
"id": "/packages/router/src/router.ts", | ||
"moduleParts": { | ||
"index.production.js": "4f60-71" | ||
"index.production.js": "8aaa-71" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "4f60-62" | ||
"uid": "8aaa-62" | ||
}, | ||
{ | ||
"uid": "4f60-46" | ||
"uid": "8aaa-46" | ||
}, | ||
{ | ||
"uid": "4f60-54" | ||
"uid": "8aaa-54" | ||
}, | ||
{ | ||
"uid": "4f60-68" | ||
"uid": "8aaa-68" | ||
}, | ||
{ | ||
"uid": "4f60-52" | ||
"uid": "8aaa-52" | ||
}, | ||
{ | ||
"uid": "4f60-50" | ||
"uid": "8aaa-50" | ||
} | ||
@@ -446,47 +446,47 @@ ], | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
} | ||
] | ||
}, | ||
"4f60-72": { | ||
"8aaa-72": { | ||
"id": "/packages/router/src/index.ts", | ||
"moduleParts": { | ||
"index.production.js": "4f60-73" | ||
"index.production.js": "8aaa-73" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "4f60-46" | ||
"uid": "8aaa-46" | ||
}, | ||
{ | ||
"uid": "4f60-48" | ||
"uid": "8aaa-48" | ||
}, | ||
{ | ||
"uid": "4f60-50" | ||
"uid": "8aaa-50" | ||
}, | ||
{ | ||
"uid": "4f60-74" | ||
"uid": "8aaa-74" | ||
}, | ||
{ | ||
"uid": "4f60-54" | ||
"uid": "8aaa-54" | ||
}, | ||
{ | ||
"uid": "4f60-56" | ||
"uid": "8aaa-56" | ||
}, | ||
{ | ||
"uid": "4f60-66" | ||
"uid": "8aaa-66" | ||
}, | ||
{ | ||
"uid": "4f60-75" | ||
"uid": "8aaa-75" | ||
}, | ||
{ | ||
"uid": "4f60-70" | ||
"uid": "8aaa-70" | ||
}, | ||
{ | ||
"uid": "4f60-68" | ||
"uid": "8aaa-68" | ||
}, | ||
{ | ||
"uid": "4f60-52" | ||
"uid": "8aaa-52" | ||
}, | ||
{ | ||
"uid": "4f60-64" | ||
"uid": "8aaa-64" | ||
} | ||
@@ -497,3 +497,3 @@ ], | ||
}, | ||
"4f60-74": { | ||
"8aaa-74": { | ||
"id": "/packages/router/src/link.ts", | ||
@@ -504,7 +504,7 @@ "moduleParts": {}, | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
} | ||
] | ||
}, | ||
"4f60-75": { | ||
"8aaa-75": { | ||
"id": "/packages/router/src/routeInfo.ts", | ||
@@ -515,7 +515,7 @@ "moduleParts": {}, | ||
{ | ||
"uid": "4f60-72" | ||
"uid": "8aaa-72" | ||
} | ||
] | ||
}, | ||
"4f60-76": { | ||
"8aaa-76": { | ||
"id": "react", | ||
@@ -526,3 +526,3 @@ "moduleParts": {}, | ||
{ | ||
"uid": "4f60-64" | ||
"uid": "8aaa-64" | ||
} | ||
@@ -532,3 +532,3 @@ ], | ||
}, | ||
"4f60-77": { | ||
"8aaa-77": { | ||
"id": "use-sync-external-store/shim/with-selector", | ||
@@ -539,3 +539,3 @@ "moduleParts": {}, | ||
{ | ||
"uid": "4f60-62" | ||
"uid": "8aaa-62" | ||
} | ||
@@ -542,0 +542,0 @@ ], |
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("use-sync-external-store/shim/with-selector")):"function"==typeof define&&define.amd?define(["exports","react","use-sync-external-store/shim/with-selector"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RouterCore={},t.React,t.withSelector)}(this,(function(t,e,r){"use strict";function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var n=o(e);function s(t,e){if(!t)throw new Error("Invariant failed")}const a="pushstate",i="popstate",c="beforeunload",h=t=>(t.preventDefault(),t.returnValue=""),u=()=>{removeEventListener(c,h,{capture:!0})};function l(t){let e=t.getLocation(),r=()=>{},o=new Set,n=[],s=[];const a=()=>{if(n.length)n[0]?.(a,(()=>{n=[],u()}));else for(;s.length;)s.shift()?.()},i=t=>{s.push(t),a()},l=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},listen:e=>(0===o.size&&(r=t.listener(l)),o.add(e),()=>{o.delete(e),0===o.size&&r()}),push:(e,r)=>{i((()=>{t.pushState(e,r)}))},replace:(e,r)=>{i((()=>{t.replaceState(e,r)}))},go:e=>{i((()=>{t.go(e)}))},back:()=>{i((()=>{t.back()}))},forward:()=>{i((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(n.push(t),1===n.length&&addEventListener(c,h,{capture:!0}),()=>{n=n.filter((e=>e!==t)),n.length||u()})}}function d(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);return l({getLocation:()=>f(e(),history.state),listener:t=>{window.addEventListener(a,t),window.addEventListener(i,t);var e=window.history.pushState;window.history.pushState=function(){let r=e.apply(history,arguments);return t(),r};var r=window.history.replaceState;return window.history.replaceState=function(){let e=r.apply(history,arguments);return t(),e},()=>{window.history.pushState=e,window.history.replaceState=r,window.removeEventListener(a,t),window.removeEventListener(i,t)}},pushState:(t,e)=>{window.history.pushState({...e,key:m()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:m()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function p(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return l({getLocation:()=>f(e[r],o),listener:()=>()=>{},pushState:(t,n)=>{o={...n,key:m()},e.push(t),r++},replaceState:(t,n)=>{o={...n,key:m()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function f(t,e){let r=t.indexOf("#"),o=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:t.length),hash:r>-1?t.substring(r):"",search:o>-1?t.slice(o,-1===r?void 0:r):"",state:e}}function m(){return(Math.random()+1).toString(36).substring(7)}function y(t){return t[t.length-1]}function g(t,e){return"function"==typeof t?t(e):t}function v(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function w(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||b(t)&&b(r)){const e=o?t.length:Object.keys(t).length,n=o?r:Object.keys(r),s=n.length,a=o?[]:{};let i=0;for(let e=0;e<s;e++){const s=o?e:n[e];a[s]=w(t[s],r[s]),a[s]===t[s]&&i++}return e===s&&i===e?t:a}return r}function b(t){if(!S(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")}function S(t){return"[object Object]"===Object.prototype.toString.call(t)}function E(t,e){return t===e||typeof t==typeof e&&(b(t)&&b(e)?!Object.keys(e).some((r=>!E(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>E(t,e[r])))))}function R(t){return P(t.filter(Boolean).join("/"))}function P(t){return t.replace(/\/{2,}/g,"/")}function _(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function x(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function M(t){return x(_(t))}function C(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=L(e);const n=L(r);n.forEach(((t,e)=>{if("/"===t.value)e?e===n.length-1&&o.push(t):o=[t];else if(".."===t.value)o.length>1&&"/"===y(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return P(R([t,...o.map((t=>t.value))]))}function L(t){if(!t)return[];const e=[];if("/"===(t=P(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>"$"===t||"*"===t?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function O(t,e,r=!1){return R(L(t).map((t=>{if("wildcard"===t.type){const o=e[t.value];return r?`${t.value}${o??""}`:o}return"param"===t.type?e[t.value.substring(1)]??"":t.value})))}function j(t,e,r){const o=k(t,e,r);if(!r.to||o)return o??{}}function k(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,n=L(e),s=L(o);e.startsWith("/")||n.unshift({type:"pathname",value:"/"}),o.startsWith("/")||s.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(n.length,s.length);t++){const e=n[t],o=s[t],i=t>=n.length-1,c=t>=s.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(a["*"]=R(n.slice(t).map((t=>t.value))),!0);if("pathname"===o.type){if("/"===o.value&&!e?.value)return!0;if(e)if(r.caseSensitive){if(o.value!==e.value)return!1}else if(o.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===o.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(a[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?a:void 0}function I(t,e){var r,o,n,s="";for(r in t)if(void 0!==(n=t[r]))if(Array.isArray(n))for(o=0;o<n.length;o++)s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(n[o]);else s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(n);return(e||"")+s}function $(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function D(t){for(var e,r,o={},n=t.split("&");e=n.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],$(e.shift())):o[r]=$(e.shift());return o}function T(){return T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},T.apply(this,arguments)} | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("use-sync-external-store/shim/with-selector")):"function"==typeof define&&define.amd?define(["exports","react","use-sync-external-store/shim/with-selector"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RouterCore={},t.React,t.withSelector)}(this,(function(t,e,r){"use strict";function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var n=o(e);function s(t,e){if(!t)throw new Error("Invariant failed")}const a="pushstate",i="popstate",c="beforeunload",h=t=>(t.preventDefault(),t.returnValue=""),u=()=>{removeEventListener(c,h,{capture:!0})};function l(t){let e=t.getLocation(),r=()=>{},o=new Set,n=[],s=[];const a=()=>{if(n.length)n[0]?.(a,(()=>{n=[],u()}));else for(;s.length;)s.shift()?.()},i=t=>{s.push(t),a()},l=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},listen:e=>(0===o.size&&(r=t.listener(l)),o.add(e),()=>{o.delete(e),0===o.size&&r()}),push:(e,r)=>{i((()=>{t.pushState(e,r)}))},replace:(e,r)=>{i((()=>{t.replaceState(e,r)}))},go:e=>{i((()=>{t.go(e)}))},back:()=>{i((()=>{t.back()}))},forward:()=>{i((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(n.push(t),1===n.length&&addEventListener(c,h,{capture:!0}),()=>{n=n.filter((e=>e!==t)),n.length||u()})}}function d(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);return l({getLocation:()=>f(e(),history.state),listener:t=>{window.addEventListener(a,t),window.addEventListener(i,t);var e=window.history.pushState;window.history.pushState=function(){let r=e.apply(history,arguments);return t(),r};var r=window.history.replaceState;return window.history.replaceState=function(){let e=r.apply(history,arguments);return t(),e},()=>{window.history.pushState=e,window.history.replaceState=r,window.removeEventListener(a,t),window.removeEventListener(i,t)}},pushState:(t,e)=>{window.history.pushState({...e,key:m()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:m()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function p(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return l({getLocation:()=>f(e[r],o),listener:()=>()=>{},pushState:(t,n)=>{o={...n,key:m()},e.push(t),r++},replaceState:(t,n)=>{o={...n,key:m()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function f(t,e){let r=t.indexOf("#"),o=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:t.length),hash:r>-1?t.substring(r):"",search:o>-1?t.slice(o,-1===r?void 0:r):"",state:e}}function m(){return(Math.random()+1).toString(36).substring(7)}function y(t){return t[t.length-1]}function g(t,e){return"function"==typeof t?t(e):t}function v(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function w(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||b(t)&&b(r)){const e=o?t.length:Object.keys(t).length,n=o?r:Object.keys(r),s=n.length,a=o?[]:{};let i=0;for(let e=0;e<s;e++){const s=o?e:n[e];a[s]=w(t[s],r[s]),a[s]===t[s]&&i++}return e===s&&i===e?t:a}return r}function b(t){if(!S(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")}function S(t){return"[object Object]"===Object.prototype.toString.call(t)}function E(t,e){return t===e||typeof t==typeof e&&(b(t)&&b(e)?!Object.keys(e).some((r=>!E(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>E(t,e[r])))))}function R(t){return P(t.filter(Boolean).join("/"))}function P(t){return t.replace(/\/{2,}/g,"/")}function _(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function x(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function M(t){return x(_(t))}function C(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=L(e);const n=L(r);n.forEach(((t,e)=>{if("/"===t.value)e?e===n.length-1&&o.push(t):o=[t];else if(".."===t.value)o.length>1&&"/"===y(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return P(R([t,...o.map((t=>t.value))]))}function L(t){if(!t)return[];const e=[];if("/"===(t=P(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>"$"===t||"*"===t?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function O(t,e,r=!1){return R(L(t).map((t=>{if("wildcard"===t.type){const o=e[t.value];return r?`${t.value}${o??""}`:o}return"param"===t.type?e[t.value.substring(1)]??"":t.value})))}function j(t,e,r){const o=k(t,e,r);if(!r.to||o)return o??{}}function k(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,n=L(e),s=L(o);e.startsWith("/")||n.unshift({type:"pathname",value:"/"}),o.startsWith("/")||s.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(n.length,s.length);t++){const e=n[t],o=s[t],i=t>=n.length-1,c=t>=s.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(a["*"]=R(n.slice(t).map((t=>t.value))),!0);if("pathname"===o.type){if("/"===o.value&&!e?.value)return!0;if(e)if(r.caseSensitive){if(o.value!==e.value)return!1}else if(o.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===o.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(a[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?a:void 0}function I(t,e){var r,o,n,s="";for(r in t)if(void 0!==(n=t[r]))if(Array.isArray(n))for(o=0;o<n.length;o++)s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(n[o]);else s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(n);return(e||"")+s}function $(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function D(t){for(var e,r,o={},n=t.split("&");e=n.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],$(e.shift())):o[r]=$(e.shift());return o}function T(){return T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},T.apply(this,arguments)} | ||
/** | ||
@@ -14,0 +14,0 @@ * @tanstack/store/src/index.ts |
{ | ||
"name": "@tanstack/router", | ||
"author": "Tanner Linsley", | ||
"version": "0.0.1-beta.139", | ||
"version": "0.0.1-beta.140", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "repository": "tanstack/router", |
@@ -33,4 +33,3 @@ // @ts-nocheck | ||
if (str === 'true') return true | ||
if (str.charAt(0) === '0') return str | ||
return +str * 0 === 0 ? +str : str | ||
return +str * 0 === 0 && +str + '' === str ? +str : str | ||
} | ||
@@ -37,0 +36,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1370772
12804