@tanstack/react-router 1.26.4 → 1.26.7

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/dist/cjs/qss.cjs CHANGED
@@ -31,12 +31,18 @@ function decode(str, pfx) {
31
31
  let tmp, k;
32
32
  const out = {}, arr = (pfx ? str.substr(pfx.length) : str).split("&");
33
33
  while (tmp = arr.shift()) {
34
- tmp = tmp.split("=");
35
- k = tmp.shift();
36
- if (out[k] !== void 0) {
37
- out[k] = [].concat(out[k], toValue(tmp.shift()));
34
+ const equalIndex = tmp.indexOf("=");
35
+ if (equalIndex !== -1) {
36
+ k = tmp.slice(0, equalIndex);
37
+ const value = tmp.slice(equalIndex + 1);
38
+ if (out[k] !== void 0) {
39
+ out[k] = [].concat(out[k], toValue(value));
40
+ } else {
41
+ out[k] = toValue(value);
42
+ }
38
43
  } else {
39
- out[k] = toValue(tmp.shift());
44
+ k = tmp;
45
+ out[k] = "";
40
46
  }
41
47
  }
42
48
  return out;
@@ -1 +1 @@
1
- {"version":3,"file":"qss.cjs","sources":["../../src/qss.ts"],"sourcesContent":["// @ts-nocheck\n\n// qss has been slightly modified and inlined here for our use cases (and compression's sake). We've included it as a hard dependency for MIT license attribution.\n\nexport function encode(obj, pfx?: string) {\n let k,\n i,\n tmp,\n str = ''\n\n for (k in obj) {\n if ((tmp = obj[k]) !== void 0) {\n if (Array.isArray(tmp)) {\n for (i = 0; i < tmp.length; i++) {\n str && (str += '&')\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i])\n }\n } else {\n str && (str += '&')\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp)\n }\n }\n }\n\n return (pfx || '') + str\n}\n\nfunction toValue(mix) {\n if (!mix) return ''\n const str = decodeURIComponent(mix)\n if (str === 'false') return false\n if (str === 'true') return true\n return +str * 0 === 0 && +str + '' === str ? +str : str\n}\n\nexport function decode(str, pfx?: string) {\n let tmp, k\n const out = {},\n arr = (pfx ? str.substr(pfx.length) : str).split('&')\n\n while ((tmp = arr.shift())) {\n tmp = tmp.split('=')\n k = tmp.shift()\n if (out[k] !== void 0) {\n out[k] = [].concat(out[k], toValue(tmp.shift()))\n } else {\n out[k] = toValue(tmp.shift())\n }\n }\n\n return out\n}\n"],"names":[],"mappings":";;AAIgB,SAAA,OAAO,KAAK,KAAc;AACpC,MAAA,GACF,GACA,KACA,MAAM;AAER,OAAK,KAAK,KAAK;AACb,SAAK,MAAM,IAAI,CAAC,OAAO,QAAQ;AACzB,UAAA,MAAM,QAAQ,GAAG,GAAG;AACtB,aAAK,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AAC/B,kBAAQ,OAAO;AACf,iBAAO,mBAAmB,CAAC,IAAI,MAAM,mBAAmB,IAAI,CAAC,CAAC;AAAA,QAChE;AAAA,MAAA,OACK;AACL,gBAAQ,OAAO;AACf,eAAO,mBAAmB,CAAC,IAAI,MAAM,mBAAmB,GAAG;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AAEA,UAAQ,OAAO,MAAM;AACvB;AAEA,SAAS,QAAQ,KAAK;AACpB,MAAI,CAAC;AAAY,WAAA;AACX,QAAA,MAAM,mBAAmB,GAAG;AAClC,MAAI,QAAQ;AAAgB,WAAA;AAC5B,MAAI,QAAQ;AAAe,WAAA;AACpB,SAAA,CAAC,MAAM,MAAM,KAAK,CAAC,MAAM,OAAO,MAAM,CAAC,MAAM;AACtD;AAEgB,SAAA,OAAO,KAAK,KAAc;AACxC,MAAI,KAAK;AACT,QAAM,MAAM,CACV,GAAA,OAAO,MAAM,IAAI,OAAO,IAAI,MAAM,IAAI,KAAK,MAAM,GAAG;AAE9C,SAAA,MAAM,IAAI,SAAU;AACpB,UAAA,IAAI,MAAM,GAAG;AACnB,QAAI,IAAI;AACJ,QAAA,IAAI,CAAC,MAAM,QAAQ;AACrB,UAAI,CAAC,IAAI,CAAC,EAAE,OAAO,IAAI,CAAC,GAAG,QAAQ,IAAI,MAAM,CAAC,CAAC;AAAA,IAAA,OAC1C;AACL,UAAI,CAAC,IAAI,QAAQ,IAAI,MAAO,CAAA;AAAA,IAC9B;AAAA,EACF;AAEO,SAAA;AACT;;;"}
1
+ {"version":3,"file":"qss.cjs","sources":["../../src/qss.ts"],"sourcesContent":["// @ts-nocheck\n\n// qss has been slightly modified and inlined here for our use cases (and compression's sake). We've included it as a hard dependency for MIT license attribution.\n\n/**\n * Encodes an object into a query string.\n * @param obj - The object to encode into a query string.\n * @param [pfx] - An optional prefix to add before the query string.\n * @returns The encoded query string.\n * @example\n * ```\n * // Example input: encode({ token: 'foo', key: 'value' })\n * // Expected output: \"token=foo&key=value\"\n * ```\n */\nexport function encode(obj, pfx?: string) {\n let k,\n i,\n tmp,\n str = ''\n\n for (k in obj) {\n if ((tmp = obj[k]) !== void 0) {\n if (Array.isArray(tmp)) {\n for (i = 0; i < tmp.length; i++) {\n str && (str += '&')\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i])\n }\n } else {\n str && (str += '&')\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp)\n }\n }\n }\n\n return (pfx || '') + str\n}\n\n/**\n * Converts a string value to its appropriate type (string, number, boolean).\n * @param mix - The string value to convert.\n * @returns The converted value.\n * @example\n * // Example input: toValue(\"123\")\n * // Expected output: 123\n */\nfunction toValue(mix) {\n if (!mix) return ''\n const str = decodeURIComponent(mix)\n if (str === 'false') return false\n if (str === 'true') return true\n return +str * 0 === 0 && +str + '' === str ? +str : str\n}\n\n/**\n * Decodes a query string into an object.\n * @param str - The query string to decode.\n * @param [pfx] - An optional prefix to filter out from the query string.\n * @returns The decoded key-value pairs in an object format.\n * @example\n * // Example input: decode(\"token=foo&key=value\")\n * // Expected output: { \"token\": \"foo\", \"key\": \"value\" }\n */\nexport function decode(str, pfx?: string) {\n let tmp, k\n const out = {},\n arr = (pfx ? str.substr(pfx.length) : str).split('&')\n\n while ((tmp = arr.shift())) {\n const equalIndex = tmp.indexOf('=')\n if (equalIndex !== -1) {\n k = tmp.slice(0, equalIndex)\n const value = tmp.slice(equalIndex + 1)\n if (out[k] !== void 0) {\n out[k] = [].concat(out[k], toValue(value))\n } else {\n out[k] = toValue(value)\n }\n } else {\n k = tmp\n out[k] = ''\n }\n }\n\n return out\n}\n"],"names":[],"mappings":";;AAegB,SAAA,OAAO,KAAK,KAAc;AACpC,MAAA,GACF,GACA,KACA,MAAM;AAER,OAAK,KAAK,KAAK;AACb,SAAK,MAAM,IAAI,CAAC,OAAO,QAAQ;AACzB,UAAA,MAAM,QAAQ,GAAG,GAAG;AACtB,aAAK,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AAC/B,kBAAQ,OAAO;AACf,iBAAO,mBAAmB,CAAC,IAAI,MAAM,mBAAmB,IAAI,CAAC,CAAC;AAAA,QAChE;AAAA,MAAA,OACK;AACL,gBAAQ,OAAO;AACf,eAAO,mBAAmB,CAAC,IAAI,MAAM,mBAAmB,GAAG;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AAEA,UAAQ,OAAO,MAAM;AACvB;AAUA,SAAS,QAAQ,KAAK;AACpB,MAAI,CAAC;AAAY,WAAA;AACX,QAAA,MAAM,mBAAmB,GAAG;AAClC,MAAI,QAAQ;AAAgB,WAAA;AAC5B,MAAI,QAAQ;AAAe,WAAA;AACpB,SAAA,CAAC,MAAM,MAAM,KAAK,CAAC,MAAM,OAAO,MAAM,CAAC,MAAM;AACtD;AAWgB,SAAA,OAAO,KAAK,KAAc;AACxC,MAAI,KAAK;AACT,QAAM,MAAM,CACV,GAAA,OAAO,MAAM,IAAI,OAAO,IAAI,MAAM,IAAI,KAAK,MAAM,GAAG;AAE9C,SAAA,MAAM,IAAI,SAAU;AACpB,UAAA,aAAa,IAAI,QAAQ,GAAG;AAClC,QAAI,eAAe,IAAI;AACjB,UAAA,IAAI,MAAM,GAAG,UAAU;AAC3B,YAAM,QAAQ,IAAI,MAAM,aAAa,CAAC;AAClC,UAAA,IAAI,CAAC,MAAM,QAAQ;AACjB,YAAA,CAAC,IAAI,CAAA,EAAG,OAAO,IAAI,CAAC,GAAG,QAAQ,KAAK,CAAC;AAAA,MAAA,OACpC;AACD,YAAA,CAAC,IAAI,QAAQ,KAAK;AAAA,MACxB;AAAA,IAAA,OACK;AACD,UAAA;AACJ,UAAI,CAAC,IAAI;AAAA,IACX;AAAA,EACF;AAEO,SAAA;AACT;;;"}
@@ -1,2 +1,22 @@
1
+ /**
2
+ * Encodes an object into a query string.
3
+ * @param obj - The object to encode into a query string.
4
+ * @param [pfx] - An optional prefix to add before the query string.
5
+ * @returns The encoded query string.
6
+ * @example
7
+ * ```
8
+ * // Example input: encode({ token: 'foo', key: 'value' })
9
+ * // Expected output: "token=foo&key=value"
10
+ * ```
11
+ */
1
12
  export declare function encode(obj: any, pfx?: string): string;
13
+ /**
14
+ * Decodes a query string into an object.
15
+ * @param str - The query string to decode.
16
+ * @param [pfx] - An optional prefix to filter out from the query string.
17
+ * @returns The decoded key-value pairs in an object format.
18
+ * @example
19
+ * // Example input: decode("token=foo&key=value")
20
+ * // Expected output: { "token": "foo", "key": "value" }
21
+ */
2
22
  export declare function decode(str: any, pfx?: string): {};
package/dist/esm/qss.d.ts CHANGED
@@ -1,2 +1,22 @@
1
+ /**
2
+ * Encodes an object into a query string.
3
+ * @param obj - The object to encode into a query string.
4
+ * @param [pfx] - An optional prefix to add before the query string.
5
+ * @returns The encoded query string.
6
+ * @example
7
+ * ```
8
+ * // Example input: encode({ token: 'foo', key: 'value' })
9
+ * // Expected output: "token=foo&key=value"
10
+ * ```
11
+ */
1
12
  export declare function encode(obj: any, pfx?: string): string;
13
+ /**
14
+ * Decodes a query string into an object.
15
+ * @param str - The query string to decode.
16
+ * @param [pfx] - An optional prefix to filter out from the query string.
17
+ * @returns The decoded key-value pairs in an object format.
18
+ * @example
19
+ * // Example input: decode("token=foo&key=value")
20
+ * // Expected output: { "token": "foo", "key": "value" }
21
+ */
2
22
  export declare function decode(str: any, pfx?: string): {};
package/dist/esm/qss.js CHANGED
@@ -29,12 +29,18 @@ function decode(str, pfx) {
29
29
  let tmp, k;
30
30
  const out = {}, arr = (pfx ? str.substr(pfx.length) : str).split("&");
31
31
  while (tmp = arr.shift()) {
32
- tmp = tmp.split("=");
33
- k = tmp.shift();
34
- if (out[k] !== void 0) {
35
- out[k] = [].concat(out[k], toValue(tmp.shift()));
32
+ const equalIndex = tmp.indexOf("=");
33
+ if (equalIndex !== -1) {
34
+ k = tmp.slice(0, equalIndex);
35
+ const value = tmp.slice(equalIndex + 1);
36
+ if (out[k] !== void 0) {
37
+ out[k] = [].concat(out[k], toValue(value));
38
+ } else {
39
+ out[k] = toValue(value);
40
+ }
36
41
  } else {
37
- out[k] = toValue(tmp.shift());
42
+ k = tmp;
43
+ out[k] = "";
38
44
  }
39
45
  }
40
46
  return out;
@@ -1 +1 @@
1
- {"version":3,"file":"qss.js","sources":["../../src/qss.ts"],"sourcesContent":["// @ts-nocheck\n\n// qss has been slightly modified and inlined here for our use cases (and compression's sake). We've included it as a hard dependency for MIT license attribution.\n\nexport function encode(obj, pfx?: string) {\n let k,\n i,\n tmp,\n str = ''\n\n for (k in obj) {\n if ((tmp = obj[k]) !== void 0) {\n if (Array.isArray(tmp)) {\n for (i = 0; i < tmp.length; i++) {\n str && (str += '&')\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i])\n }\n } else {\n str && (str += '&')\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp)\n }\n }\n }\n\n return (pfx || '') + str\n}\n\nfunction toValue(mix) {\n if (!mix) return ''\n const str = decodeURIComponent(mix)\n if (str === 'false') return false\n if (str === 'true') return true\n return +str * 0 === 0 && +str + '' === str ? +str : str\n}\n\nexport function decode(str, pfx?: string) {\n let tmp, k\n const out = {},\n arr = (pfx ? str.substr(pfx.length) : str).split('&')\n\n while ((tmp = arr.shift())) {\n tmp = tmp.split('=')\n k = tmp.shift()\n if (out[k] !== void 0) {\n out[k] = [].concat(out[k], toValue(tmp.shift()))\n } else {\n out[k] = toVal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src/qss.ts"],"sourcesContent":["// @ts-nocheck\n\n// qss has been slightly modified and inlined here for our use cases (and compression's sake). We've included it as a hard dependency for MIT license attribution.\n\n/**\n * Encodes an object into a query string.\n * @param obj - The object to encode into a query string.\n * @param [pfx] - An optional prefix to add before the query string.\n * @returns The encoded query string.\n * @example\n * ```\n * // Example input: encode({ token: 'foo', key: 'value' })\n * // Expected output: \"token=foo&key=value\"\n * ```\n */\nexport function encode(obj, pfx?: string) {\n let k,\n i,\n tmp,\n str = ''\n\n for (k in obj) {\n if ((tmp = obj[k]) !== void 0) {\n if (Array.isArray(tmp)) {\n for (i = 0; i < tmp.length; i++) {\n str && (str += '&')\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i])\n }\n } else {\n str && (str += '&')\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp)\n }\n }\n }\n\n return (pfx || '') + str\n}\n\n/**\n * Converts a string value to its appropriate type (string, number, boolean).\n * @param mix - The string value to convert.\n * @returns The converted value.\n * @example\n * // Example input: toValue(\"123\")\n * // Expected output: 123\n */\nfunction toValue(mix) {\n if (!mix) return ''\n const str = decodeURIComponent(mix)\n if (str === 'false') return false\n if (str === 'true') return true\n return +str * 0 === 0 && +str + '' === str ? +str : str\n}\n\n/**\n * Decodes a query string into an object.\n * @param str - The query string to decode.\n * @param [pfx] - An optional prefix to filter out from the query string.\n * @returns The decoded key-value pairs in an object format.\n * @example\n * // Example input: decode(\"token=foo&key=value\")\n * // Expected output: { \"token\": \"foo\", \"key\": \"value\" }\n */\nexport function decode(str, pfx?: string) {\n let tmp, k\n const out = {},\n arr = (pfx ? str.substr(pfx.length) : str).split('&')\n\n while ((tmp = arr.shift())) {\n const equalIndex = tmp.indexOf('=')\n if (equalIndex !== -1) {\n k = tmp.slice(0, equalIndex)\n const value = tmp.slice(equalIndex + 1)\n if (out[k] !== void 0) {\n out[k] = [].concat(out[k], toValue(value))\n } else {\n out[k] = toValue(value)\n }\n } else {\n k = tmp\n out[k] = ''\n }\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,OACK;AACD,UAAA;AACJ,UAAI,CAAC,IAAI;AAAA,IACX;AAAA,EACF;AAEO,SAAA;AACT;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.26.4",
3
+ "version": "1.26.7",
4
4
  "description": "",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/qss.ts CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  // qss has been slightly modified and inlined here for our use cases (and compression's sake). We've included it as a hard dependency for MIT license attribution.
4
4
 
5
+ /**
6
+ * Encodes an object into a query string.
7
+ * @param obj - The object to encode into a query string.
8
+ * @param [pfx] - An optional prefix to add before the query string.
9
+ * @returns The encoded query string.
10
+ * @example
11
+ * ```
12
+ * // Example input: encode({ token: 'foo', key: 'value' })
13
+ * // Expected output: "token=foo&key=value"
14
+ * ```
15
+ */
5
16
  export function encode(obj, pfx?: string) {
6
17
  let k,
7
18
  i,
@@ -25,6 +36,14 @@ export function encode(obj, pfx?: string) {
25
36
  return (pfx || '') + str
26
37
  }
27
38
 
39
+ /**
40
+ * Converts a string value to its appropriate type (string, number, boolean).
41
+ * @param mix - The string value to convert.
42
+ * @returns The converted value.
43
+ * @example
44
+ * // Example input: toValue("123")
45
+ * // Expected output: 123
46
+ */
28
47
  function toValue(mix) {
29
48
  if (!mix) return ''
30
49
  const str = decodeURIComponent(mix)
@@ -33,18 +52,33 @@ function toValue(mix) {
33
52
  return +str * 0 === 0 && +str + '' === str ? +str : str
34
53
  }
35
54
 
55
+ /**
56
+ * Decodes a query string into an object.
57
+ * @param str - The query string to decode.
58
+ * @param [pfx] - An optional prefix to filter out from the query string.
59
+ * @returns The decoded key-value pairs in an object format.
60
+ * @example
61
+ * // Example input: decode("token=foo&key=value")
62
+ * // Expected output: { "token": "foo", "key": "value" }
63
+ */
36
64
  export function decode(str, pfx?: string) {
37
65
  let tmp, k
38
66
  const out = {},
39
67
  arr = (pfx ? str.substr(pfx.length) : str).split('&')
40
68
 
41
69
  while ((tmp = arr.shift())) {
42
- tmp = tmp.split('=')
43
- k = tmp.shift()
44
- if (out[k] !== void 0) {
45
- out[k] = [].concat(out[k], toValue(tmp.shift()))
70
+ const equalIndex = tmp.indexOf('=')
71
+ if (equalIndex !== -1) {
72
+ k = tmp.slice(0, equalIndex)
73
+ const value = tmp.slice(equalIndex + 1)
74
+ if (out[k] !== void 0) {
75
+ out[k] = [].concat(out[k], toValue(value))
76
+ } else {
77
+ out[k] = toValue(value)
78
+ }
46
79
  } else {
47
- out[k] = toValue(tmp.shift())
80
+ k = tmp
81
+ out[k] = ''
48
82
  }
49
83
  }
50
84