@moneko/react 2.1.0 → 2.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.
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Path } from 'react-router-dom';
|
|
2
2
|
declare function parse(reserved?: string | string[]): string[];
|
|
3
3
|
declare function parseReservedWord(reserved?: string | string[]): string[];
|
|
4
|
+
type SearchParams = ConstructorParameters<typeof URLSearchParams>[0];
|
|
5
|
+
type NormalRecord = Record<string, string | number | boolean | undefined | null>;
|
|
4
6
|
export interface IPath extends Partial<Omit<Path, 'search'>> {
|
|
5
|
-
search?:
|
|
7
|
+
search?: SearchParams | NormalRecord;
|
|
6
8
|
}
|
|
7
9
|
export type To = string | IPath;
|
|
8
10
|
declare const parseToByReservedWord: (to: To | number, reserved?: string | string[]) => Partial<Path>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default((e,a)=>{let r,t,s;if("number"==typeof e)return e;if("string"==typeof e){let a=e.split("?");t=a[0],r=new URLSearchParams(a[1])}else{let a=e.pathname?e.pathname.split("?"):[];t=a[0],r=new URLSearchParams(e.search),a[1]&&new URLSearchParams(a[1]).forEach((e,a)=>{r.has(a)||r.set(a,e)}),s=e.hash}let h=new URLSearchParams(location.search);return Array.from(new Set(["menuId","dynamicTitle"].concat(Array.isArray(a)?a:a?[a]:[]))).forEach(e=>{h.has(e)&&!r.has(e)
|
|
1
|
+
export default((e,a)=>{let r,t,s;if("number"==typeof e)return e;if("string"==typeof e){let a=e.split("?");t=a[0],r=new URLSearchParams(a[1])}else{let a=e.pathname?e.pathname.split("?"):[];t=a[0],r=new URLSearchParams(e.search),a[1]&&new URLSearchParams(a[1]).forEach((e,a)=>{r.has(a)||r.set(a,e)}),s=e.hash}let h=new URLSearchParams(location.search);return Array.from(new Set(["menuId","dynamicTitle"].concat(Array.isArray(a)?a:a?[a]:[]))).forEach(e=>{if(h.has(e)&&!r.has(e)){let a=h.get(e);void 0===a?r.delete(e):r.set(e,a??"")}}),{pathname:t,search:r.toString(),hash:s}});
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"react-dom";import{injectIntoGlobalHook as o}from"react-refresh";o(window),window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject(r);
|