utils-lib-js 2.0.24 → 2.2.0
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/bundle/base.d.ts +1 -1
- package/dist/bundle/index.d.ts +3 -3
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/object.d.ts +4 -4
- package/dist/bundle/types.d.ts +7 -9
- package/dist/cjs/base.d.ts +1 -1
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/object.d.ts +4 -4
- package/dist/cjs/types.d.ts +7 -9
- package/dist/esm/base.d.ts +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/object.d.ts +4 -4
- package/dist/esm/types.d.ts +7 -9
- package/dist/umd/base.d.ts +1 -1
- package/dist/umd/index.d.ts +3 -3
- package/dist/umd/index.js +1 -1
- package/dist/umd/object.d.ts +4 -4
- package/dist/umd/types.d.ts +7 -9
- package/package.json +1 -1
package/dist/umd/object.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const getValue: IGetValue;
|
|
|
3
3
|
export declare const setValue: ISetValue;
|
|
4
4
|
export declare const mixIn: IMixIn;
|
|
5
5
|
export declare const enumInversion: IEnumInversion;
|
|
6
|
-
export declare const isNotObject: (source: any, type:
|
|
6
|
+
export declare const isNotObject: (source: any, type: string) => boolean;
|
|
7
7
|
export declare const cloneDeep: ICloneDeep;
|
|
8
8
|
export declare const createObjectVariable: ICreateObjectVariable;
|
|
9
9
|
export declare const createObject: ICreateObject;
|
|
@@ -20,7 +20,7 @@ declare const _default: {
|
|
|
20
20
|
setValue: ISetValue;
|
|
21
21
|
mixIn: IMixIn;
|
|
22
22
|
enumInversion: IEnumInversion;
|
|
23
|
-
isNotObject: (source: any, type:
|
|
23
|
+
isNotObject: (source: any, type: string) => boolean;
|
|
24
24
|
cloneDeep: ICloneDeep;
|
|
25
25
|
createObjectVariable: ICreateObjectVariable;
|
|
26
26
|
createObject: ICreateObject;
|
|
@@ -30,7 +30,7 @@ declare const _default: {
|
|
|
30
30
|
stringToJson: IStringToJson;
|
|
31
31
|
jsonToString: IJsonToString;
|
|
32
32
|
isWindow: (win: any) => boolean;
|
|
33
|
-
emptyObject: (init?: IObject<unknown>) => any;
|
|
34
|
-
isEmptyObject: (object?: IObject<unknown>) => boolean;
|
|
33
|
+
emptyObject: (init?: IObject<unknown, import("./types").IKey>) => any;
|
|
34
|
+
isEmptyObject: (object?: IObject<unknown, import("./types").IKey>) => boolean;
|
|
35
35
|
};
|
|
36
36
|
export default _default;
|
package/dist/umd/types.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export type IKey = string | symbol | number;
|
|
2
|
-
export
|
|
3
|
-
[key: IKey]: T | IObject<any>;
|
|
4
|
-
}
|
|
2
|
+
export type IObject<V = any, K extends string | number | symbol = IKey> = Record<K, V>;
|
|
5
3
|
export interface IPromise extends IObject<any> {
|
|
6
|
-
promise
|
|
7
|
-
resolve
|
|
8
|
-
reject
|
|
4
|
+
promise?: Promise<void>;
|
|
5
|
+
resolve?: (res?: any) => unknown;
|
|
6
|
+
reject?: (err?: any) => unknown;
|
|
9
7
|
}
|
|
10
8
|
export type IInstance<T> = {
|
|
11
9
|
_instance: Function;
|
|
@@ -13,12 +11,12 @@ export type IInstance<T> = {
|
|
|
13
11
|
export type IDemoteArray<T> = Array<IDemoteArray<T> | T>;
|
|
14
12
|
export type IRandomNum = (min: number, max: number, bool?: boolean) => number;
|
|
15
13
|
export type IUrlSplit = (url: string) => IObject<any>;
|
|
16
|
-
export type IUrlJoin = (url: string, query:
|
|
14
|
+
export type IUrlJoin = (url: string, query: IObject) => string;
|
|
17
15
|
export type IGetType<T> = (data: any) => typeof data | T[keyof T] | "null";
|
|
18
16
|
export type IGetTypeByList = (data: any, whiteList: string[]) => boolean;
|
|
19
17
|
export type IGetValue = <T, U = IObject<T> | IObject<T>[IKey]>(object: U, key: string, defaultValue?: any) => U;
|
|
20
18
|
export type ISetValue = <T>(object: IObject<T>, key: string, value?: any) => IObject<T>;
|
|
21
|
-
export type IMixIn = <U extends IObject<any>>(target?: U, source?: IObject<any>, overwrite?: boolean) => U;
|
|
19
|
+
export type IMixIn = <U extends IObject<any>>(target?: U, source?: IObject<any>, overwrite?: boolean) => U | void;
|
|
22
20
|
export type IEnumInversion = (target: IObject<string>) => IObject<string>;
|
|
23
21
|
export type ICloneDeep = (target?: any) => any;
|
|
24
22
|
export type ICreateObjectVariable = (type: string, source?: any) => any;
|
|
@@ -67,7 +65,7 @@ export type IAnimateFrame = {
|
|
|
67
65
|
isActive: boolean;
|
|
68
66
|
fn(timer: number): void;
|
|
69
67
|
start(duration: number): void;
|
|
70
|
-
stop(id?: number): void;
|
|
68
|
+
stop(id?: number | null): void;
|
|
71
69
|
animate(timer: number): void;
|
|
72
70
|
};
|
|
73
71
|
export {};
|