state-in-url 6.1.1 → 6.1.2

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/README.CN.md CHANGED
@@ -100,6 +100,7 @@
100
100
  ## 目录
101
101
 
102
102
  - [State in url](#state-in-url)
103
+ - [State in url](#state-in-url-1)
103
104
  - [演示](#演示)
104
105
  - [为什么使用 `state-in-url`?](#为什么使用-state-in-url)
105
106
  - [使用场景](#使用场景)
@@ -621,7 +622,7 @@ const tags = [
621
622
  ];
622
623
  ```
623
624
 
624
- [演示页面示例代码](https://github.com/asmyshlyaev177/state-in-url/blob/master/packages/example-nextjs14/src/app/Form.tsx)
625
+ [演示页面示例代码](https://github.com/asmyshlyaev177/state-in-url/blob/master/packages/example-nextjs15/src/app/Form.tsx)
625
626
  </details>
626
627
 
627
628
  ##### 仅更新状态并手动同步到 URL
package/README.KO.md CHANGED
@@ -136,6 +136,7 @@ Next.js와 react-router용 `useUrlState` 훅과 그 외 JS 환경을 위한 헬
136
136
  - [변경 로그](#변경-로그)
137
137
  - [언급](#언급)
138
138
  - [라이선스](#라이선스)
139
+ - [개인 웹사이트](#개인-웹사이트)
139
140
  - [영감](#영감)
140
141
 
141
142
  ## 설치
@@ -614,7 +615,7 @@ const tags = [
614
615
  ];
615
616
  ```
616
617
 
617
- [데모 페이지 예제 코드](https://github.com/asmyshlyaev177/state-in-url/blob/master/packages/example-nextjs14/src/app/Form.tsx)
618
+ [데모 페이지 예제 코드](https://github.com/asmyshlyaev177/state-in-url/blob/master/packages/example-nextjs15/src/app/Form.tsx)
618
619
  </details>
619
620
 
620
621
  ##### 상태만 업데이트하고 URL에 수동으로 동기화
package/README.md CHANGED
@@ -621,7 +621,7 @@ const tags = [
621
621
  ];
622
622
  ```
623
623
 
624
- [Demo page example code](https://github.com/asmyshlyaev177/state-in-url/blob/master/packages/example-nextjs14/src/app/Form.tsx)
624
+ [Demo page example code](https://github.com/asmyshlyaev177/state-in-url/blob/master/packages/example-nextjs15/src/app/Form.tsx)
625
625
  </details>
626
626
 
627
627
  ##### Update state only and sync to URL manually
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type Type = "string" | "date" | "boolean" | "number" | "bigint" | "undefined" | "object" | "null" | "function" | "symbol" | "array";
1
+ export type Type = 'string' | 'date' | 'boolean' | 'number' | 'bigint' | 'undefined' | 'object' | 'null' | 'function' | 'symbol' | 'array';
2
2
  /**
3
3
  * A better replacement for `typeof`
4
4
  *
@@ -23,7 +23,7 @@ export type UnknownObj = object | {
23
23
  };
24
24
  export declare const isEqual: (val1: unknown, val2: unknown) => boolean;
25
25
  export declare function filterUnknownParamsClient<T extends object>(shape: T, params?: string | URLSearchParams | Record<string, string> | object): string;
26
- export declare function filterUnknownParams<T extends object>(shape: T, searchParams?: object): T;
26
+ export declare function filterUnknownParams<T extends object>(shape: T, searchParams?: object | URLSearchParams): T;
27
27
  export declare function filterUnknown<T extends object>(shape: T, entries: [key: string, value: string][]): string[][];
28
28
  export declare function assignValue<T extends object>(shape: T, newVal: Partial<T>): T;
29
29
  export interface Router {
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- "use strict";const i=n=>{if(n===null)return"null";const t=typeof n;if(t!=="object")return t;if(Array.isArray(n))return"array";if(n instanceof Date)return"date";return"object"};const u=n=>{const t=i(n);return t!=="object"&&t!=="array"};const a=typeof window==="undefined";const l=n=>{if(n instanceof URLSearchParams){return n}if(typeof n==="string"){const t=n.indexOf("?");return new URLSearchParams(t===-1?n:n.slice(t+1))}return new URLSearchParams};const y=(n,t)=>{if(n.length!==t.length)return false;return n.every((r,s)=>c(r,t[s]))};const w=(n,t)=>{const r=Object.keys(n);const s=Object.keys(t);if(r.length!==s.length)return false;return r.every(e=>c(n[e],t[e]))};const c=(n,t)=>{if(n===t)return true;if(n==null||t==null)return false;const r=i(n);const s=i(t);if(r!==s)return false;if(u(n))return false;if(r==="array"){return y(n,t)}if(r==="object"){return w(n,t)}return JSON.stringify(n)===JSON.stringify(t)};function p(n,t){const r=new URLSearchParams;const s=f(n,[...new URLSearchParams(t||"").entries()]);for(const[e,o]of s){r.set(e,o)}return r.toString()}function g(n,t){return Object.fromEntries(f(n,Object.entries(t||{})))}function f(n,t){const r=Object.keys(n);const s=[];for(let e=0;e<t.length;e++){if(r.includes(t[e]?.[0])){s.push([t[e][0].replace(/\+/g," "),t[e][1]])}}return s}function h(n,t){const r=Object.assign({},n);for(const[s]of Object.entries(n)){const e=s;const o=t[e]!==void 0;r[e]=o?t[e]:n[e]}return r}const S={push:n=>{if(typeof window!=="undefined"){window.history.pushState(null,"",n)}},replace:n=>{if(typeof window!=="undefined"){window.history.replaceState(null,"",n)}}};const d=/apple/i.test(!a&&navigator?.userAgent||"");const m="popstate";function P(){return a?"":window.location.search}exports.assignValue=h;exports.filterUnknown=f;exports.filterUnknownParams=g;exports.filterUnknownParamsClient=p;exports.getParams=l;exports.getSearch=P;exports.isEqual=c;exports.isPrimitive=u;exports.isSSR=a;exports.isSafari=d;exports.popstateEv=m;exports.routerHistory=S;exports.typeOf=i;
1
+ "use strict";const i=n=>{if(n===null)return"null";const t=typeof n;if(t!=="object")return t;if(Array.isArray(n))return"array";if(n instanceof Date)return"date";return"object"};const u=n=>{const t=i(n);return t!=="object"&&t!=="array"};const a=typeof window==="undefined";const l=n=>{if(n instanceof URLSearchParams){return n}if(typeof n==="string"){const t=n.indexOf("?");return new URLSearchParams(t===-1?n:n.slice(t+1))}return new URLSearchParams};const y=(n,t)=>{if(n.length!==t.length)return false;return n.every((r,s)=>c(r,t[s]))};const w=(n,t)=>{const r=Object.keys(n);const s=Object.keys(t);if(r.length!==s.length)return false;return r.every(e=>c(n[e],t[e]))};const c=(n,t)=>{if(n===t)return true;if(n==null||t==null)return false;const r=i(n);const s=i(t);if(r!==s)return false;if(u(n))return false;if(r==="array"){return y(n,t)}if(r==="object"){return w(n,t)}return JSON.stringify(n)===JSON.stringify(t)};function p(n,t){const r=new URLSearchParams;const s=f(n,[...new URLSearchParams(t||"").entries()]);for(const[e,o]of s){r.set(e,o)}return r.toString()}function g(n,t){const r=t instanceof URLSearchParams?[...t.entries()]:Object.entries(t||{});return Object.fromEntries(f(n,r))}function f(n,t){const r=Object.keys(n);const s=[];for(let e=0;e<t.length;e++){if(r.includes(t[e]?.[0])){s.push([t[e][0].replace(/\+/g," "),t[e][1]])}}return s}function h(n,t){const r=Object.assign({},n);for(const[s]of Object.entries(n)){const e=s;const o=t[e]!==void 0;r[e]=o?t[e]:n[e]}return r}const S={push:n=>{if(typeof window!=="undefined"){window.history.pushState(null,"",n)}},replace:n=>{if(typeof window!=="undefined"){window.history.replaceState(null,"",n)}}};const d=/apple/i.test(!a&&navigator?.userAgent||"");const m="popstate";function P(){return a?"":window.location.search}exports.assignValue=h;exports.filterUnknown=f;exports.filterUnknownParams=g;exports.filterUnknownParamsClient=p;exports.getParams=l;exports.getSearch=P;exports.isEqual=c;exports.isPrimitive=u;exports.isSSR=a;exports.isSafari=d;exports.popstateEv=m;exports.routerHistory=S;exports.typeOf=i;
package/dist/utils.mjs CHANGED
@@ -1 +1 @@
1
- const o=n=>{if(n===null)return"null";const t=typeof n;if(t!=="object")return t;if(Array.isArray(n))return"array";if(n instanceof Date)return"date";return"object"};const u=n=>{const t=o(n);return t!=="object"&&t!=="array"};const a=typeof window==="undefined";const l=n=>{if(n instanceof URLSearchParams){return n}if(typeof n==="string"){const t=n.indexOf("?");return new URLSearchParams(t===-1?n:n.slice(t+1))}return new URLSearchParams};const y=(n,t)=>{if(n.length!==t.length)return false;return n.every((r,s)=>c(r,t[s]))};const p=(n,t)=>{const r=Object.keys(n);const s=Object.keys(t);if(r.length!==s.length)return false;return r.every(e=>c(n[e],t[e]))};const c=(n,t)=>{if(n===t)return true;if(n==null||t==null)return false;const r=o(n);const s=o(t);if(r!==s)return false;if(u(n))return false;if(r==="array"){return y(n,t)}if(r==="object"){return p(n,t)}return JSON.stringify(n)===JSON.stringify(t)};function w(n,t){const r=new URLSearchParams;const s=f(n,[...new URLSearchParams(t||"").entries()]);for(const[e,i]of s){r.set(e,i)}return r.toString()}function h(n,t){return Object.fromEntries(f(n,Object.entries(t||{})))}function f(n,t){const r=Object.keys(n);const s=[];for(let e=0;e<t.length;e++){if(r.includes(t[e]?.[0])){s.push([t[e][0].replace(/\+/g," "),t[e][1]])}}return s}function d(n,t){const r=Object.assign({},n);for(const[s]of Object.entries(n)){const e=s;const i=t[e]!==void 0;r[e]=i?t[e]:n[e]}return r}const g={push:n=>{if(typeof window!=="undefined"){window.history.pushState(null,"",n)}},replace:n=>{if(typeof window!=="undefined"){window.history.replaceState(null,"",n)}}};const S=/apple/i.test(!a&&navigator?.userAgent||"");const b="popstate";function j(){return a?"":window.location.search}export{d as assignValue,f as filterUnknown,h as filterUnknownParams,w as filterUnknownParamsClient,l as getParams,j as getSearch,c as isEqual,u as isPrimitive,a as isSSR,S as isSafari,b as popstateEv,g as routerHistory,o as typeOf};
1
+ const o=n=>{if(n===null)return"null";const t=typeof n;if(t!=="object")return t;if(Array.isArray(n))return"array";if(n instanceof Date)return"date";return"object"};const u=n=>{const t=o(n);return t!=="object"&&t!=="array"};const a=typeof window==="undefined";const l=n=>{if(n instanceof URLSearchParams){return n}if(typeof n==="string"){const t=n.indexOf("?");return new URLSearchParams(t===-1?n:n.slice(t+1))}return new URLSearchParams};const y=(n,t)=>{if(n.length!==t.length)return false;return n.every((r,s)=>c(r,t[s]))};const p=(n,t)=>{const r=Object.keys(n);const s=Object.keys(t);if(r.length!==s.length)return false;return r.every(e=>c(n[e],t[e]))};const c=(n,t)=>{if(n===t)return true;if(n==null||t==null)return false;const r=o(n);const s=o(t);if(r!==s)return false;if(u(n))return false;if(r==="array"){return y(n,t)}if(r==="object"){return p(n,t)}return JSON.stringify(n)===JSON.stringify(t)};function w(n,t){const r=new URLSearchParams;const s=f(n,[...new URLSearchParams(t||"").entries()]);for(const[e,i]of s){r.set(e,i)}return r.toString()}function h(n,t){const r=t instanceof URLSearchParams?[...t.entries()]:Object.entries(t||{});return Object.fromEntries(f(n,r))}function f(n,t){const r=Object.keys(n);const s=[];for(let e=0;e<t.length;e++){if(r.includes(t[e]?.[0])){s.push([t[e][0].replace(/\+/g," "),t[e][1]])}}return s}function d(n,t){const r=Object.assign({},n);for(const[s]of Object.entries(n)){const e=s;const i=t[e]!==void 0;r[e]=i?t[e]:n[e]}return r}const g={push:n=>{if(typeof window!=="undefined"){window.history.pushState(null,"",n)}},replace:n=>{if(typeof window!=="undefined"){window.history.replaceState(null,"",n)}}};const S=/apple/i.test(!a&&navigator?.userAgent||"");const b="popstate";function j(){return a?"":window.location.search}export{d as assignValue,f as filterUnknown,h as filterUnknownParams,w as filterUnknownParamsClient,l as getParams,j as getSearch,c as isEqual,u as isPrimitive,a as isSSR,S as isSafari,b as popstateEv,g as routerHistory,o as typeOf};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "state-in-url",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
4
4
  "description": "Store state in URL as in object, types and structure are preserved, with TS validation. Same API as React.useState, wthout any hasssle or boilerplate. Next.js@14-15, react-router@6-7, and remix@2.",
5
5
  "homepage": "https://state-in-url.dev",
6
6
  "repository": {
@@ -477,17 +477,19 @@
477
477
  "eslint-plugin-react-hooks": "^4.6.2",
478
478
  "eslint-plugin-simple-import-sort": "^12.1.1",
479
479
  "glob": "^13.0.0",
480
- "happy-dom": "^15.11.7",
480
+ "happy-dom": "^20.0.2",
481
481
  "husky": "^9.1.7",
482
482
  "lint-staged": "^15.5.2",
483
+ "next": "^15.5.9",
483
484
  "nyc": "^17.1.0",
484
485
  "only-allow": "^1.2.1",
485
486
  "pin-github-action": "^1.9.1",
486
487
  "playwright": "^1.55.1",
487
488
  "prettier": "^3.6.2",
488
489
  "prettier-plugin-tailwindcss": "^0.6.14",
490
+ "react": "^19.2.1",
491
+ "react-dom": "^19.2.1",
489
492
  "react-router": "^7.10.1",
490
- "release-it": "^17.11.0",
491
493
  "rollup": "^4.52.3",
492
494
  "rollup-plugin-esbuild": "^6.2.1",
493
495
  "rollup-plugin-filesize": "^10.0.0",
@@ -499,10 +501,7 @@
499
501
  "unplugin-auto-import": "^0.18.6",
500
502
  "vitest": "^2.1.9",
501
503
  "wait-on": "^8.0.5",
502
- "wireit": "^0.14.12",
503
- "next": "^15.5.9",
504
- "react": "^19.2.1",
505
- "react-dom": "^19.2.1"
504
+ "wireit": "^0.14.12"
506
505
  },
507
506
  "keywords": [
508
507
  "state in url",