Socket
Socket
Sign inDemoInstall

@tanstack/router

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/router - npm Package Compare versions

Comparing version 0.0.1-beta.110 to 0.0.1-beta.111

2

build/cjs/history.js

@@ -117,3 +117,3 @@ /**

function createBrowserHistory(opts) {
const getHref = opts?.getHref ?? (() => `${window.location.pathname}${window.location.hash}${window.location.search}`);
const getHref = opts?.getHref ?? (() => `${window.location.pathname}${window.location.search}${window.location.hash}`);
const createHref = opts?.createHref ?? (path => path);

@@ -120,0 +120,0 @@ const getLocation = () => parseLocation(getHref(), history.state);

@@ -14,7 +14,7 @@ {

"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"uid": "98e0-49"
"uid": "f6e1-49"
},
{
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"uid": "98e0-51"
"uid": "f6e1-51"
}

@@ -30,39 +30,39 @@ ]

{
"uid": "98e0-53",
"uid": "f6e1-53",
"name": "history.ts"
},
{
"uid": "98e0-55",
"uid": "f6e1-55",
"name": "utils.ts"
},
{
"uid": "98e0-57",
"uid": "f6e1-57",
"name": "path.ts"
},
{
"uid": "98e0-59",
"uid": "f6e1-59",
"name": "qss.ts"
},
{
"uid": "98e0-67",
"uid": "f6e1-67",
"name": "react.tsx"
},
{
"uid": "98e0-69",
"uid": "f6e1-69",
"name": "route.ts"
},
{
"uid": "98e0-71",
"uid": "f6e1-71",
"name": "searchParams.ts"
},
{
"uid": "98e0-73",
"uid": "f6e1-73",
"name": "router.ts"
},
{
"uid": "98e0-75",
"uid": "f6e1-75",
"name": "routeMatch.ts"
},
{
"uid": "98e0-77",
"uid": "f6e1-77",
"name": "index.ts"

@@ -74,7 +74,7 @@ }

"name": "store/build/esm/index.js",
"uid": "98e0-63"
"uid": "f6e1-63"
},
{
"name": "react-store/build/esm/index.js",
"uid": "98e0-65"
"uid": "f6e1-65"
}

@@ -84,3 +84,3 @@ ]

{
"uid": "98e0-61",
"uid": "f6e1-61",
"name": "\u0000rollupPluginBabelHelpers.js"

@@ -94,98 +94,98 @@ }

"nodeParts": {
"98e0-49": {
"f6e1-49": {
"renderedLength": 199,
"gzipLength": 134,
"brotliLength": 0,
"mainUid": "98e0-48"
"mainUid": "f6e1-48"
},
"98e0-51": {
"f6e1-51": {
"renderedLength": 48,
"gzipLength": 65,
"brotliLength": 0,
"mainUid": "98e0-50"
"mainUid": "f6e1-50"
},
"98e0-53": {
"f6e1-53": {
"renderedLength": 5643,
"gzipLength": 1404,
"brotliLength": 0,
"mainUid": "98e0-52"
"mainUid": "f6e1-52"
},
"98e0-55": {
"f6e1-55": {
"renderedLength": 2821,
"gzipLength": 990,
"brotliLength": 0,
"mainUid": "98e0-54"
"mainUid": "f6e1-54"
},
"98e0-57": {
"f6e1-57": {
"renderedLength": 6028,
"gzipLength": 1423,
"brotliLength": 0,
"mainUid": "98e0-56"
"mainUid": "f6e1-56"
},
"98e0-59": {
"f6e1-59": {
"renderedLength": 1395,
"gzipLength": 558,
"brotliLength": 0,
"mainUid": "98e0-58"
"mainUid": "f6e1-58"
},
"98e0-61": {
"f6e1-61": {
"renderedLength": 457,
"gzipLength": 241,
"brotliLength": 0,
"mainUid": "98e0-60"
"mainUid": "f6e1-60"
},
"98e0-63": {
"f6e1-63": {
"renderedLength": 1459,
"gzipLength": 543,
"brotliLength": 0,
"mainUid": "98e0-62"
"mainUid": "f6e1-62"
},
"98e0-65": {
"f6e1-65": {
"renderedLength": 1066,
"gzipLength": 481,
"brotliLength": 0,
"mainUid": "98e0-64"
"mainUid": "f6e1-64"
},
"98e0-67": {
"f6e1-67": {
"renderedLength": 14227,
"gzipLength": 3360,
"brotliLength": 0,
"mainUid": "98e0-66"
"mainUid": "f6e1-66"
},
"98e0-69": {
"f6e1-69": {
"renderedLength": 3556,
"gzipLength": 903,
"brotliLength": 0,
"mainUid": "98e0-68"
"mainUid": "f6e1-68"
},
"98e0-71": {
"f6e1-71": {
"renderedLength": 1387,
"gzipLength": 483,
"brotliLength": 0,
"mainUid": "98e0-70"
"mainUid": "f6e1-70"
},
"98e0-73": {
"f6e1-73": {
"renderedLength": 31263,
"gzipLength": 7732,
"brotliLength": 0,
"mainUid": "98e0-72"
"mainUid": "f6e1-72"
},
"98e0-75": {
"f6e1-75": {
"renderedLength": 8853,
"gzipLength": 1927,
"brotliLength": 0,
"mainUid": "98e0-74"
"mainUid": "f6e1-74"
},
"98e0-77": {
"f6e1-77": {
"renderedLength": 0,
"gzipLength": 0,
"brotliLength": 0,
"mainUid": "98e0-76"
"mainUid": "f6e1-76"
}
},
"nodeMetas": {
"98e0-48": {
"f6e1-48": {
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"moduleParts": {
"index.production.js": "98e0-49"
"index.production.js": "f6e1-49"
},

@@ -195,19 +195,19 @@ "imported": [],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-68"
"uid": "f6e1-68"
},
{
"uid": "98e0-72"
"uid": "f6e1-72"
},
{
"uid": "98e0-66"
"uid": "f6e1-66"
}
]
},
"98e0-50": {
"f6e1-50": {
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"moduleParts": {
"index.production.js": "98e0-51"
"index.production.js": "f6e1-51"
},

@@ -217,13 +217,13 @@ "imported": [],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-66"
"uid": "f6e1-66"
}
]
},
"98e0-52": {
"f6e1-52": {
"id": "/packages/router/src/history.ts",
"moduleParts": {
"index.production.js": "98e0-53"
"index.production.js": "f6e1-53"
},

@@ -233,13 +233,13 @@ "imported": [],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-72"
"uid": "f6e1-72"
}
]
},
"98e0-54": {
"f6e1-54": {
"id": "/packages/router/src/utils.ts",
"moduleParts": {
"index.production.js": "98e0-55"
"index.production.js": "f6e1-55"
},

@@ -249,26 +249,26 @@ "imported": [],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-56"
"uid": "f6e1-56"
},
{
"uid": "98e0-74"
"uid": "f6e1-74"
},
{
"uid": "98e0-72"
"uid": "f6e1-72"
},
{
"uid": "98e0-66"
"uid": "f6e1-66"
}
]
},
"98e0-56": {
"f6e1-56": {
"id": "/packages/router/src/path.ts",
"moduleParts": {
"index.production.js": "98e0-57"
"index.production.js": "f6e1-57"
},
"imported": [
{
"uid": "98e0-54"
"uid": "f6e1-54"
}

@@ -278,16 +278,16 @@ ],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-68"
"uid": "f6e1-68"
},
{
"uid": "98e0-72"
"uid": "f6e1-72"
}
]
},
"98e0-58": {
"f6e1-58": {
"id": "/packages/router/src/qss.ts",
"moduleParts": {
"index.production.js": "98e0-59"
"index.production.js": "f6e1-59"
},

@@ -297,13 +297,13 @@ "imported": [],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-70"
"uid": "f6e1-70"
}
]
},
"98e0-60": {
"f6e1-60": {
"id": "\u0000rollupPluginBabelHelpers.js",
"moduleParts": {
"index.production.js": "98e0-61"
"index.production.js": "f6e1-61"
},

@@ -313,10 +313,10 @@ "imported": [],

{
"uid": "98e0-66"
"uid": "f6e1-66"
}
]
},
"98e0-62": {
"f6e1-62": {
"id": "/packages/store/build/esm/index.js",
"moduleParts": {
"index.production.js": "98e0-63"
"index.production.js": "f6e1-63"
},

@@ -326,17 +326,17 @@ "imported": [],

{
"uid": "98e0-64"
"uid": "f6e1-64"
}
]
},
"98e0-64": {
"f6e1-64": {
"id": "/packages/react-store/build/esm/index.js",
"moduleParts": {
"index.production.js": "98e0-65"
"index.production.js": "f6e1-65"
},
"imported": [
{
"uid": "98e0-81"
"uid": "f6e1-81"
},
{
"uid": "98e0-62"
"uid": "f6e1-62"
}

@@ -346,35 +346,35 @@ ],

{
"uid": "98e0-74"
"uid": "f6e1-74"
},
{
"uid": "98e0-72"
"uid": "f6e1-72"
},
{
"uid": "98e0-66"
"uid": "f6e1-66"
}
]
},
"98e0-66": {
"f6e1-66": {
"id": "/packages/router/src/react.tsx",
"moduleParts": {
"index.production.js": "98e0-67"
"index.production.js": "f6e1-67"
},
"imported": [
{
"uid": "98e0-60"
"uid": "f6e1-60"
},
{
"uid": "98e0-80"
"uid": "f6e1-80"
},
{
"uid": "98e0-64"
"uid": "f6e1-64"
},
{
"uid": "98e0-48"
"uid": "f6e1-48"
},
{
"uid": "98e0-50"
"uid": "f6e1-50"
},
{
"uid": "98e0-54"
"uid": "f6e1-54"
}

@@ -384,23 +384,23 @@ ],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-68"
"uid": "f6e1-68"
}
]
},
"98e0-68": {
"f6e1-68": {
"id": "/packages/router/src/route.ts",
"moduleParts": {
"index.production.js": "98e0-69"
"index.production.js": "f6e1-69"
},
"imported": [
{
"uid": "98e0-48"
"uid": "f6e1-48"
},
{
"uid": "98e0-56"
"uid": "f6e1-56"
},
{
"uid": "98e0-66"
"uid": "f6e1-66"
}

@@ -410,14 +410,14 @@ ],

{
"uid": "98e0-76"
"uid": "f6e1-76"
}
]
},
"98e0-70": {
"f6e1-70": {
"id": "/packages/router/src/searchParams.ts",
"moduleParts": {
"index.production.js": "98e0-71"
"index.production.js": "f6e1-71"
},
"imported": [
{
"uid": "98e0-58"
"uid": "f6e1-58"
}

@@ -427,35 +427,35 @@ ],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-72"
"uid": "f6e1-72"
}
]
},
"98e0-72": {
"f6e1-72": {
"id": "/packages/router/src/router.ts",
"moduleParts": {
"index.production.js": "98e0-73"
"index.production.js": "f6e1-73"
},
"imported": [
{
"uid": "98e0-64"
"uid": "f6e1-64"
},
{
"uid": "98e0-48"
"uid": "f6e1-48"
},
{
"uid": "98e0-56"
"uid": "f6e1-56"
},
{
"uid": "98e0-74"
"uid": "f6e1-74"
},
{
"uid": "98e0-70"
"uid": "f6e1-70"
},
{
"uid": "98e0-54"
"uid": "f6e1-54"
},
{
"uid": "98e0-52"
"uid": "f6e1-52"
}

@@ -465,23 +465,23 @@ ],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-74"
"uid": "f6e1-74"
}
]
},
"98e0-74": {
"f6e1-74": {
"id": "/packages/router/src/routeMatch.ts",
"moduleParts": {
"index.production.js": "98e0-75"
"index.production.js": "f6e1-75"
},
"imported": [
{
"uid": "98e0-64"
"uid": "f6e1-64"
},
{
"uid": "98e0-72"
"uid": "f6e1-72"
},
{
"uid": "98e0-54"
"uid": "f6e1-54"
}

@@ -491,53 +491,53 @@ ],

{
"uid": "98e0-76"
"uid": "f6e1-76"
},
{
"uid": "98e0-72"
"uid": "f6e1-72"
}
]
},
"98e0-76": {
"f6e1-76": {
"id": "/packages/router/src/index.ts",
"moduleParts": {
"index.production.js": "98e0-77"
"index.production.js": "f6e1-77"
},
"imported": [
{
"uid": "98e0-48"
"uid": "f6e1-48"
},
{
"uid": "98e0-50"
"uid": "f6e1-50"
},
{
"uid": "98e0-52"
"uid": "f6e1-52"
},
{
"uid": "98e0-78"
"uid": "f6e1-78"
},
{
"uid": "98e0-56"
"uid": "f6e1-56"
},
{
"uid": "98e0-58"
"uid": "f6e1-58"
},
{
"uid": "98e0-68"
"uid": "f6e1-68"
},
{
"uid": "98e0-79"
"uid": "f6e1-79"
},
{
"uid": "98e0-74"
"uid": "f6e1-74"
},
{
"uid": "98e0-72"
"uid": "f6e1-72"
},
{
"uid": "98e0-70"
"uid": "f6e1-70"
},
{
"uid": "98e0-54"
"uid": "f6e1-54"
},
{
"uid": "98e0-66"
"uid": "f6e1-66"
}

@@ -548,3 +548,3 @@ ],

},
"98e0-78": {
"f6e1-78": {
"id": "/packages/router/src/link.ts",

@@ -555,7 +555,7 @@ "moduleParts": {},

{
"uid": "98e0-76"
"uid": "f6e1-76"
}
]
},
"98e0-79": {
"f6e1-79": {
"id": "/packages/router/src/routeInfo.ts",

@@ -566,7 +566,7 @@ "moduleParts": {},

{
"uid": "98e0-76"
"uid": "f6e1-76"
}
]
},
"98e0-80": {
"f6e1-80": {
"id": "react",

@@ -577,3 +577,3 @@ "moduleParts": {},

{
"uid": "98e0-66"
"uid": "f6e1-66"
}

@@ -583,3 +583,3 @@ ],

},
"98e0-81": {
"f6e1-81": {
"id": "use-sync-external-store/shim/with-selector",

@@ -590,3 +590,3 @@ "moduleParts": {},

{
"uid": "98e0-64"
"uid": "f6e1-64"
}

@@ -593,0 +593,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 a=o(e);function s(t,e){if(!t)throw new Error("Invariant failed")}function n(t,e){}const 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,a=[],s=[];const n=()=>{if(a.length)a[0]?.(n,(()=>{a=[],u()}));else{for(;s.length;)s.shift()?.();l()}},i=t=>{s.push(t),n()},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=>(a.push(t),1===a.length&&addEventListener(c,h,{capture:!0}),()=>{a=a.filter((e=>e!==t)),a.length||u()})}}function d(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.hash}${window.location.search}`),r=t?.createHref??(t=>t);return l({getLocation:()=>f(e(),history.state),listener:t=>(window.addEventListener(i,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,a)=>{o={...a,key:m()},e.push(t),r++},replaceState:(t,a)=>{o={...a,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 _(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||w(t)&&w(r)){const e=o?t.length:Object.keys(t).length,a=o?r:Object.keys(r),s=a.length,n=o?[]:{};let i=0;for(let e=0;e<s;e++){const s=o?e:a[e];n[s]=_(t[s],r[s]),n[s]===t[s]&&i++}return e===s&&i===e?t:n}return r}function w(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 b(t,e){return t===e||typeof t==typeof e&&(w(t)&&w(e)?!Object.keys(e).some((r=>!b(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>b(t,e[r])))))}function E(t){return P(t.filter(Boolean).join("/"))}function P(t){return t.replace(/\/{2,}/g,"/")}function x(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function R(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function C(t){return R(x(t))}function L(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=k(e);const a=k(r);a.forEach(((t,e)=>{if("/"===t.value)e?e===a.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(E([t,...o.map((t=>t.value))]))}function k(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 j(t,e,r=!1){return E(k(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 O(t,e,r){const o=D(t,e,r);if(!r.to||o)return o??{}}function D(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,a=k(e),s=k(o);e.startsWith("/")||a.unshift({type:"pathname",value:"/"}),o.startsWith("/")||s.unshift({type:"pathname",value:"/"});const n={};return(()=>{for(let t=0;t<Math.max(a.length,s.length);t++){const e=a[t],o=s[t],i=t>=a.length-1,c=t>=s.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(n["*"]=E(a.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)&&(n[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?n:void 0}function M(t,e){var r,o,a,s="";for(r in t)if(void 0!==(a=t[r]))if(Array.isArray(a))for(o=0;o<a.length;o++)s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(a[o]);else s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(a);return(e||"")+s}function A(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function T(t){for(var e,r,o={},a=t.split("&");e=a.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],A(e.shift())):o[r]=A(e.shift());return o}function $(){return $=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},$.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 a=o(e);function s(t,e){if(!t)throw new Error("Invariant failed")}function n(t,e){}const 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,a=[],s=[];const n=()=>{if(a.length)a[0]?.(n,(()=>{a=[],u()}));else{for(;s.length;)s.shift()?.();l()}},i=t=>{s.push(t),n()},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=>(a.push(t),1===a.length&&addEventListener(c,h,{capture:!0}),()=>{a=a.filter((e=>e!==t)),a.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(i,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,a)=>{o={...a,key:m()},e.push(t),r++},replaceState:(t,a)=>{o={...a,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 _(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||w(t)&&w(r)){const e=o?t.length:Object.keys(t).length,a=o?r:Object.keys(r),s=a.length,n=o?[]:{};let i=0;for(let e=0;e<s;e++){const s=o?e:a[e];n[s]=_(t[s],r[s]),n[s]===t[s]&&i++}return e===s&&i===e?t:n}return r}function w(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 b(t,e){return t===e||typeof t==typeof e&&(w(t)&&w(e)?!Object.keys(e).some((r=>!b(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>b(t,e[r])))))}function E(t){return P(t.filter(Boolean).join("/"))}function P(t){return t.replace(/\/{2,}/g,"/")}function x(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function R(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function C(t){return R(x(t))}function L(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=k(e);const a=k(r);a.forEach(((t,e)=>{if("/"===t.value)e?e===a.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(E([t,...o.map((t=>t.value))]))}function k(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 j(t,e,r=!1){return E(k(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 O(t,e,r){const o=D(t,e,r);if(!r.to||o)return o??{}}function D(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,a=k(e),s=k(o);e.startsWith("/")||a.unshift({type:"pathname",value:"/"}),o.startsWith("/")||s.unshift({type:"pathname",value:"/"});const n={};return(()=>{for(let t=0;t<Math.max(a.length,s.length);t++){const e=a[t],o=s[t],i=t>=a.length-1,c=t>=s.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(n["*"]=E(a.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)&&(n[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?n:void 0}function M(t,e){var r,o,a,s="";for(r in t)if(void 0!==(a=t[r]))if(Array.isArray(a))for(o=0;o<a.length;o++)s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(a[o]);else s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(a);return(e||"")+s}function A(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function T(t){for(var e,r,o={},a=t.split("&");e=a.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],A(e.shift())):o[r]=A(e.shift());return o}function $(){return $=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},$.apply(this,arguments)}
/**

@@ -14,0 +14,0 @@ * @tanstack/store/src/index.ts

{
"name": "@tanstack/router",
"author": "Tanner Linsley",
"version": "0.0.1-beta.110",
"version": "0.0.1-beta.111",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "tanstack/router",

@@ -157,3 +157,3 @@ // While the public API was clearly inspired by the "history" npm package,

(() =>
`${window.location.pathname}${window.location.hash}${window.location.search}`)
`${window.location.pathname}${window.location.search}${window.location.hash}`)
const createHref = opts?.createHref ?? ((path) => path)

@@ -160,0 +160,0 @@ const getLocation = () => parseLocation(getHref(), history.state)

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc