@lowentry/utils 1.19.2 → 1.19.4
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/build/LeTypes.d.ts +1 -1
- package/build/LeUtils.d.ts +103 -104
- package/build/classes/SerializableMap.d.ts +2 -2
- package/index.d.ts +19 -19
- package/index.js +26 -24
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/LeTypes.js +1 -1
- package/src/LeUtils.js +23 -22
- package/src/classes/SerializableMap.js +1 -1
package/build/LeTypes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export function ISSET(value: any): boolean;
|
|
|
2
2
|
export function IS_ARRAY(value: any): boolean;
|
|
3
3
|
export function ARRAY(value: any): any[];
|
|
4
4
|
export function IS_OBJECT(value: any): boolean;
|
|
5
|
-
export function OBJECT(value: any):
|
|
5
|
+
export function OBJECT(value: any): any;
|
|
6
6
|
export function STRING(value: any): string;
|
|
7
7
|
export function STRING_ANY(...values: any): string;
|
|
8
8
|
export function INT(value: any): number;
|
package/build/LeUtils.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export namespace LeUtils {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
function equals(value: any, other: any): boolean;
|
|
3
|
+
function clone(value: any): any;
|
|
4
|
+
function onDomReady(callback: Function): {
|
|
5
5
|
remove: Function;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
function parseVersionString(versionString: string | any): {
|
|
8
8
|
major: (number);
|
|
9
9
|
minor: (number);
|
|
10
10
|
patch: (number);
|
|
@@ -15,110 +15,110 @@ export namespace LeUtils {
|
|
|
15
15
|
largerThan: ((arg0: string | any) => boolean);
|
|
16
16
|
largerThanOrEquals: ((arg0: string | any) => boolean);
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
function contains(array: any[] | any | Function, value: any): boolean;
|
|
19
|
+
function containsCaseInsensitive(array: any[] | any | Function, value: any): boolean;
|
|
20
|
+
function containsAll(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
21
|
+
function containsAllCaseInsensitive(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
22
|
+
function containsAny(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
23
|
+
function containsAnyCaseInsensitive(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
24
|
+
function containsNone(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
25
|
+
function containsNoneCaseInsensitive(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
26
|
+
function findIndexValue(elements: any[] | any | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): {
|
|
27
27
|
index: any;
|
|
28
28
|
value: any;
|
|
29
29
|
} | null;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
30
|
+
function findIndex(elements: any[] | any | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any | null;
|
|
31
|
+
function find(elements: any[] | any | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any | null;
|
|
32
|
+
function getValueAtIndex(elements: any, index: any, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
33
|
+
function supportsEach(elements: any): boolean;
|
|
34
|
+
function eachIterator(elements: any, optionalSkipHasOwnPropertyCheck?: boolean): Generator<any, void, unknown>;
|
|
35
|
+
function each(elements: any, callback: (value: any, index?: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
36
|
+
function eachAsync(elements: any, asyncCallback: any, parallelCount?: number, optionalSkipHasOwnPropertyCheck?: boolean): Promise<any>;
|
|
37
|
+
function getEmptySimplifiedCollection(elements: any): [boolean, any[] | any | Map<any, any>, (value: any, index: any) => void];
|
|
38
|
+
function filter(elements: any, callback?: (value: any, index: any) => boolean | undefined, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
39
|
+
function map(elements: any, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
40
|
+
function mapToArray(elements: any, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
|
|
41
|
+
function mapToArraySorted(elements: any, comparator: (valueA: any, valueB: any) => number, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
|
|
42
|
+
function sortKeys(elements: any, comparator: (valueA: any, valueB: any) => number, optionalSkipHasOwnPropertyCheck?: boolean): any[];
|
|
43
|
+
function flattenArray(array: any): any[];
|
|
44
|
+
function flattenToArray(elements: any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
|
|
45
|
+
function compare(a: any, b: any): number;
|
|
46
|
+
function compareNumbers(a: number, b: number): number;
|
|
47
|
+
function compareNumericStrings(a: string | number, b: string | number): number;
|
|
48
|
+
function compareNaturalStrings(a: string, b: string): number;
|
|
49
|
+
function compareTimestampStrings(a: string, b: string): number;
|
|
50
|
+
function isEmptyObject(obj: any, optionalSkipHasOwnPropertyCheck?: boolean | undefined): boolean;
|
|
51
|
+
function getObjectFieldsCount(obj: any, optionalSkipHasOwnPropertyCheck?: boolean | undefined): number;
|
|
52
|
+
function isGeneratorFunction(func: any): any;
|
|
53
|
+
function setTimeout(callback: (deltaTime: number) => any, ms: number): {
|
|
54
54
|
remove: Function;
|
|
55
55
|
};
|
|
56
|
-
|
|
56
|
+
function setInterval(callback: (deltaTime: number) => any, intervalMs?: number, fireImmediately?: boolean): {
|
|
57
57
|
remove: Function;
|
|
58
58
|
};
|
|
59
|
-
|
|
59
|
+
function setAnimationFrameTimeout(callback: (deltaTime: number) => any, frames?: number): {
|
|
60
60
|
remove: Function;
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
function setAnimationFrameInterval(callback: (deltaTime: number) => any, intervalFrames?: number, fireImmediately?: boolean): {
|
|
63
63
|
remove: Function;
|
|
64
64
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
function promiseTimeout(ms: number): Promise<number>;
|
|
66
|
+
function promiseAnimationFrameTimeout(frames: number): Promise<number>;
|
|
67
|
+
function fetch(url: string, options?: {
|
|
68
68
|
retries?: number | null;
|
|
69
69
|
delay?: number | ((attempt: number) => number) | null;
|
|
70
|
-
} |
|
|
70
|
+
} | any | null): {
|
|
71
71
|
then: Function;
|
|
72
72
|
catch: Function;
|
|
73
73
|
finally: Function;
|
|
74
74
|
remove: Function;
|
|
75
75
|
isRemoved: Function;
|
|
76
76
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
77
|
+
function cachedFetch(url: any, options: any, responseFunction: any): Promise<any>;
|
|
78
|
+
function platformIsMobile(): boolean;
|
|
79
|
+
function platformHasCursor(): boolean;
|
|
80
|
+
function capitalize(string: string): string;
|
|
81
|
+
function endsWithAny(string: string, endingCharsStringOrArray: string | string[]): boolean;
|
|
82
|
+
function startsWithAny(string: string, startingCharsStringOrArray: string | string[]): boolean;
|
|
83
|
+
function trimEnd(string: string, trimCharsStringOrArray: string | string[]): string;
|
|
84
|
+
function trimStart(string: string, trimCharsStringOrArray: string | string[]): string;
|
|
85
|
+
function trim(string: string, trimCharsStringOrArray: string | string[]): string;
|
|
86
|
+
function purgeSentence(sentence: string): string;
|
|
87
|
+
function purgeErrorMessage(error: any): string;
|
|
88
|
+
function generateNamePermutations(...names: string[]): string[];
|
|
89
|
+
function increaseNumericStringByOne(string: string): string;
|
|
90
|
+
function uniqueId(): string;
|
|
91
|
+
function timestamp(now?: number | null | undefined): string;
|
|
92
|
+
function getEmptyImageSrc(): string;
|
|
93
|
+
function getPercentage(part: number | string, total: number | string): number;
|
|
94
|
+
function getImagePixels(image: HTMLImageElement): Uint8ClampedArray;
|
|
95
|
+
function getColoredImage(image: HTMLImageElement, color: string): string;
|
|
96
|
+
function rgbToHex(rgb: number[]): string;
|
|
97
|
+
function hexToRgb(hexstring: string): number[];
|
|
98
|
+
function rgbToHsl(rgb: number[]): number[];
|
|
99
|
+
function hslToRgb(hsl: any): number[];
|
|
100
|
+
function rgbToLab(rgb: number[]): number[];
|
|
101
|
+
function getDifferenceBetweenRgb(rgbA: number[], rgbB: number[]): number;
|
|
102
|
+
function getDifferenceBetweenLab(labA: number[], labB: number[]): number;
|
|
103
|
+
function getRgbOfGradient(gradient: {
|
|
104
104
|
percentage?: number[];
|
|
105
105
|
}, percentage: number): number[];
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
106
|
+
function getRgbBetween(startRgb: number[], endRgb: number[], percentage: number): number[];
|
|
107
|
+
function btoa(string: string): string;
|
|
108
|
+
function atob(base64string: string): string;
|
|
109
|
+
function utf8ToBase64(string: string): string;
|
|
110
|
+
function base64ToUtf8(base64string: string): string;
|
|
111
|
+
function base64ToHex(base64string: string): string;
|
|
112
|
+
function hexToBase64(hexstring: string): string;
|
|
113
|
+
function base64ToBytes(base64string: string): Uint8Array;
|
|
114
|
+
function bytesToBase64(arraybuffer: ArrayLike<number> | ArrayBuffer): string;
|
|
115
|
+
function downloadFile(base64string: string, fileName?: string, mimeType?: string): void;
|
|
116
|
+
function localStorageGet(id: string): any;
|
|
117
|
+
function localStorageSet(id: string, data: any): void;
|
|
118
|
+
function localStorageRemove(id: string): void;
|
|
119
|
+
function isCurrentHostPrivate(): boolean;
|
|
120
|
+
function isGivenHostPrivate(host: string): boolean;
|
|
121
|
+
function createTreeSet(elements: any[], comparator: (valueA: any, valueB: any) => number): {
|
|
122
122
|
getElements: (() => any[]);
|
|
123
123
|
getComparator: (() => ((valueA: any, valueB: any) => number));
|
|
124
124
|
size: (() => number);
|
|
@@ -133,86 +133,85 @@ export namespace LeUtils {
|
|
|
133
133
|
getEqualValue: ((value: any) => any);
|
|
134
134
|
getEqualValueOrAdd: ((value: any) => any);
|
|
135
135
|
};
|
|
136
|
-
|
|
136
|
+
function createTransactionalValue(value?: any): {
|
|
137
137
|
value: any;
|
|
138
138
|
changes: {
|
|
139
139
|
id: string;
|
|
140
140
|
value: any;
|
|
141
141
|
}[];
|
|
142
142
|
};
|
|
143
|
-
|
|
143
|
+
function isTransactionalValueValid(transactionalValue: {
|
|
144
144
|
value: any;
|
|
145
145
|
changes: {
|
|
146
146
|
id: string;
|
|
147
147
|
value: any;
|
|
148
148
|
}[];
|
|
149
149
|
}): boolean;
|
|
150
|
-
|
|
150
|
+
function transactionalValueToString(transactionalValue: {
|
|
151
151
|
value: any;
|
|
152
152
|
changes: {
|
|
153
153
|
id: string;
|
|
154
154
|
value: any;
|
|
155
155
|
}[];
|
|
156
156
|
}): string;
|
|
157
|
-
|
|
157
|
+
function transactionSetAndCommit(transactionalValue: {
|
|
158
158
|
value: any;
|
|
159
159
|
changes: {
|
|
160
160
|
id: string;
|
|
161
161
|
value: any;
|
|
162
162
|
}[];
|
|
163
163
|
}, value: any): void;
|
|
164
|
-
|
|
164
|
+
function transactionSetWithoutCommitting(transactionalValue: {
|
|
165
165
|
value: any;
|
|
166
166
|
changes: {
|
|
167
167
|
id: string;
|
|
168
168
|
value: any;
|
|
169
169
|
}[];
|
|
170
170
|
}, value: any): string;
|
|
171
|
-
|
|
171
|
+
function transactionCommitChange(transactionalValue: {
|
|
172
172
|
value: any;
|
|
173
173
|
changes: {
|
|
174
174
|
id: string;
|
|
175
175
|
value: any;
|
|
176
176
|
}[];
|
|
177
177
|
}, changeId: string): boolean;
|
|
178
|
-
|
|
178
|
+
function transactionCancelChange(transactionalValue: {
|
|
179
179
|
value: any;
|
|
180
180
|
changes: {
|
|
181
181
|
id: string;
|
|
182
182
|
value: any;
|
|
183
183
|
}[];
|
|
184
184
|
}, changeId: string): boolean;
|
|
185
|
-
|
|
185
|
+
function transactionIsChangeRelevant(transactionalValue: {
|
|
186
186
|
value: any;
|
|
187
187
|
changes: {
|
|
188
188
|
id: string;
|
|
189
189
|
value: any;
|
|
190
190
|
}[];
|
|
191
191
|
}, changeId: string): boolean;
|
|
192
|
-
|
|
192
|
+
function transactionGetCommittedValue(transactionalValue: {
|
|
193
193
|
value: any;
|
|
194
194
|
changes: {
|
|
195
195
|
id: string;
|
|
196
196
|
value: any;
|
|
197
197
|
}[];
|
|
198
198
|
}): any;
|
|
199
|
-
|
|
199
|
+
function transactionGetValue(transactionalValue: {
|
|
200
200
|
value: any;
|
|
201
201
|
changes: {
|
|
202
202
|
id: string;
|
|
203
203
|
value: any;
|
|
204
204
|
}[];
|
|
205
205
|
}): any;
|
|
206
|
-
|
|
206
|
+
function createWorkerThread(name: string): {
|
|
207
207
|
worker: Worker | null;
|
|
208
208
|
sendMessage: (data: any, options: {
|
|
209
209
|
timeout: number | undefined;
|
|
210
210
|
} | undefined) => Promise<any>;
|
|
211
211
|
};
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
function sendWorkerMessage(workerName: any, data: any, options: any): any;
|
|
213
|
+
function purgeEmail(email: string): string;
|
|
214
|
+
function isFocusClear(): boolean;
|
|
215
|
+
function getUserLocale(): any;
|
|
216
|
+
function getUserLocaleDateFormat(): any;
|
|
217
217
|
}
|
|
218
|
-
import FastDeepEqual from 'fast-deep-equal';
|
package/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare function IS_OBJECT(value: any): boolean;
|
|
|
23
23
|
export declare function ISSET(value: any): boolean;
|
|
24
24
|
|
|
25
25
|
export declare namespace LeUtils {
|
|
26
|
-
|
|
26
|
+
export function equals(value: any, other: any): boolean;
|
|
27
27
|
export function clone(value: any): any;
|
|
28
28
|
export function onDomReady(callback: Function): {
|
|
29
29
|
remove: Function;
|
|
@@ -39,26 +39,26 @@ export declare namespace LeUtils {
|
|
|
39
39
|
largerThan: ((arg0: string | any) => boolean);
|
|
40
40
|
largerThanOrEquals: ((arg0: string | any) => boolean);
|
|
41
41
|
};
|
|
42
|
-
export function contains(array: any[] |
|
|
43
|
-
export function containsCaseInsensitive(array: any[] |
|
|
44
|
-
export function containsAll(array: any[] |
|
|
45
|
-
export function containsAllCaseInsensitive(array: any[] |
|
|
46
|
-
export function containsAny(array: any[] |
|
|
47
|
-
export function containsAnyCaseInsensitive(array: any[] |
|
|
48
|
-
export function containsNone(array: any[] |
|
|
49
|
-
export function containsNoneCaseInsensitive(array: any[] |
|
|
50
|
-
export function findIndexValue(elements: any[] |
|
|
42
|
+
export function contains(array: any[] | any | Function, value: any): boolean;
|
|
43
|
+
export function containsCaseInsensitive(array: any[] | any | Function, value: any): boolean;
|
|
44
|
+
export function containsAll(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
45
|
+
export function containsAllCaseInsensitive(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
46
|
+
export function containsAny(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
47
|
+
export function containsAnyCaseInsensitive(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
48
|
+
export function containsNone(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
49
|
+
export function containsNoneCaseInsensitive(array: any[] | any | Function, values: any[] | any | Function): boolean;
|
|
50
|
+
export function findIndexValue(elements: any[] | any | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): {
|
|
51
51
|
index: any;
|
|
52
52
|
value: any;
|
|
53
53
|
} | null;
|
|
54
|
-
export function findIndex(elements: any[] |
|
|
55
|
-
export function find(elements: any[] |
|
|
54
|
+
export function findIndex(elements: any[] | any | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any | null;
|
|
55
|
+
export function find(elements: any[] | any | Function, callback: (value: any, index: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any | null;
|
|
56
56
|
export function getValueAtIndex(elements: any, index: any, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
57
57
|
export function supportsEach(elements: any): boolean;
|
|
58
58
|
export function eachIterator(elements: any, optionalSkipHasOwnPropertyCheck?: boolean): Generator<any, void, unknown>;
|
|
59
59
|
export function each(elements: any, callback: (value: any, index?: any) => boolean | void, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
60
60
|
export function eachAsync(elements: any, asyncCallback: any, parallelCount?: number, optionalSkipHasOwnPropertyCheck?: boolean): Promise<any>;
|
|
61
|
-
export function getEmptySimplifiedCollection(elements: any): [boolean, any[] |
|
|
61
|
+
export function getEmptySimplifiedCollection(elements: any): [boolean, any[] | any | Map<any, any>, (value: any, index: any) => void];
|
|
62
62
|
export function filter(elements: any, callback?: (value: any, index: any) => boolean | undefined, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
63
63
|
export function map(elements: any, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any;
|
|
64
64
|
export function mapToArray(elements: any, callback?: (value: any, index: any) => any, optionalSkipHasOwnPropertyCheck?: boolean): any[];
|
|
@@ -71,8 +71,8 @@ export declare namespace LeUtils {
|
|
|
71
71
|
export function compareNumericStrings(a: string | number, b: string | number): number;
|
|
72
72
|
export function compareNaturalStrings(a: string, b: string): number;
|
|
73
73
|
export function compareTimestampStrings(a: string, b: string): number;
|
|
74
|
-
export function isEmptyObject(obj:
|
|
75
|
-
export function getObjectFieldsCount(obj:
|
|
74
|
+
export function isEmptyObject(obj: any, optionalSkipHasOwnPropertyCheck?: boolean | undefined): boolean;
|
|
75
|
+
export function getObjectFieldsCount(obj: any, optionalSkipHasOwnPropertyCheck?: boolean | undefined): number;
|
|
76
76
|
export function isGeneratorFunction(func: any): any;
|
|
77
77
|
export function setTimeout(callback: (deltaTime: number) => any, ms: number): {
|
|
78
78
|
remove: Function;
|
|
@@ -91,7 +91,7 @@ export declare namespace LeUtils {
|
|
|
91
91
|
export function fetch(url: string, options?: {
|
|
92
92
|
retries?: number | null;
|
|
93
93
|
delay?: number | ((attempt: number) => number) | null;
|
|
94
|
-
} |
|
|
94
|
+
} | any | null): {
|
|
95
95
|
then: Function;
|
|
96
96
|
catch: Function;
|
|
97
97
|
finally: Function;
|
|
@@ -274,7 +274,7 @@ export declare class LinkedList {
|
|
|
274
274
|
#private;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
export declare function OBJECT(value: any):
|
|
277
|
+
export declare function OBJECT(value: any): any;
|
|
278
278
|
|
|
279
279
|
/**
|
|
280
280
|
* SerializableMap class extends the native Map to provide a JSON representation.
|
|
@@ -289,9 +289,9 @@ export declare class SerializableMap extends Map<any, any> {
|
|
|
289
289
|
/**
|
|
290
290
|
* Returns a JSON representation of the map.
|
|
291
291
|
*
|
|
292
|
-
* @returns {
|
|
292
|
+
* @returns {Object}
|
|
293
293
|
*/
|
|
294
|
-
toJSON():
|
|
294
|
+
toJSON(): any;
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
export declare function STRING(value: any): string;
|
package/index.js
CHANGED
|
@@ -61,7 +61,7 @@ var IS_OBJECT = function IS_OBJECT(value) {
|
|
|
61
61
|
* Ensures the given value is an object (returns an empty object if it's not).
|
|
62
62
|
*
|
|
63
63
|
* @param value
|
|
64
|
-
* @returns {
|
|
64
|
+
* @returns {Object}
|
|
65
65
|
*/
|
|
66
66
|
var OBJECT = function OBJECT(value) {
|
|
67
67
|
return IS_OBJECT(value) ? value : {};
|
|
@@ -254,7 +254,9 @@ var LeUtils = {
|
|
|
254
254
|
* @param {*} other The other value to compare.
|
|
255
255
|
* @returns {boolean} Returns true if the values are equivalent.
|
|
256
256
|
*/
|
|
257
|
-
equals:
|
|
257
|
+
equals: function equals(value, other) {
|
|
258
|
+
return FastDeepEqual(value, other);
|
|
259
|
+
},
|
|
258
260
|
/**
|
|
259
261
|
* Returns a deep copy of the given value.
|
|
260
262
|
*
|
|
@@ -383,7 +385,7 @@ var LeUtils = {
|
|
|
383
385
|
*
|
|
384
386
|
* Values are compared by casting both of them to a string.
|
|
385
387
|
*
|
|
386
|
-
* @param {
|
|
388
|
+
* @param {*[]|Object|Function} array
|
|
387
389
|
* @param {*} value
|
|
388
390
|
* @returns {boolean}
|
|
389
391
|
*/
|
|
@@ -406,7 +408,7 @@ var LeUtils = {
|
|
|
406
408
|
*
|
|
407
409
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
408
410
|
*
|
|
409
|
-
* @param {
|
|
411
|
+
* @param {*[]|Object|Function} array
|
|
410
412
|
* @param {*} value
|
|
411
413
|
* @returns {boolean}
|
|
412
414
|
*/
|
|
@@ -429,8 +431,8 @@ var LeUtils = {
|
|
|
429
431
|
*
|
|
430
432
|
* Values are compared by casting both of them to a string.
|
|
431
433
|
*
|
|
432
|
-
* @param {
|
|
433
|
-
* @param {
|
|
434
|
+
* @param {*[]|Object|Function} array
|
|
435
|
+
* @param {*[]|Object|Function} values
|
|
434
436
|
* @returns {boolean}
|
|
435
437
|
*/
|
|
436
438
|
containsAll: function containsAll(array, values) {
|
|
@@ -451,8 +453,8 @@ var LeUtils = {
|
|
|
451
453
|
*
|
|
452
454
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
453
455
|
*
|
|
454
|
-
* @param {
|
|
455
|
-
* @param {
|
|
456
|
+
* @param {*[]|Object|Function} array
|
|
457
|
+
* @param {*[]|Object|Function} values
|
|
456
458
|
* @returns {boolean}
|
|
457
459
|
*/
|
|
458
460
|
containsAllCaseInsensitive: function containsAllCaseInsensitive(array, values) {
|
|
@@ -473,8 +475,8 @@ var LeUtils = {
|
|
|
473
475
|
*
|
|
474
476
|
* Values are compared by casting both of them to a string.
|
|
475
477
|
*
|
|
476
|
-
* @param {
|
|
477
|
-
* @param {
|
|
478
|
+
* @param {*[]|Object|Function} array
|
|
479
|
+
* @param {*[]|Object|Function} values
|
|
478
480
|
* @returns {boolean}
|
|
479
481
|
*/
|
|
480
482
|
containsAny: function containsAny(array, values) {
|
|
@@ -495,8 +497,8 @@ var LeUtils = {
|
|
|
495
497
|
*
|
|
496
498
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
497
499
|
*
|
|
498
|
-
* @param {
|
|
499
|
-
* @param {
|
|
500
|
+
* @param {*[]|Object|Function} array
|
|
501
|
+
* @param {*[]|Object|Function} values
|
|
500
502
|
* @returns {boolean}
|
|
501
503
|
*/
|
|
502
504
|
containsAnyCaseInsensitive: function containsAnyCaseInsensitive(array, values) {
|
|
@@ -517,8 +519,8 @@ var LeUtils = {
|
|
|
517
519
|
*
|
|
518
520
|
* Values are compared by casting both of them to a string.
|
|
519
521
|
*
|
|
520
|
-
* @param {
|
|
521
|
-
* @param {
|
|
522
|
+
* @param {*[]|Object|Function} array
|
|
523
|
+
* @param {*[]|Object|Function} values
|
|
522
524
|
* @returns {boolean}
|
|
523
525
|
*/
|
|
524
526
|
containsNone: function containsNone(array, values) {
|
|
@@ -539,8 +541,8 @@ var LeUtils = {
|
|
|
539
541
|
*
|
|
540
542
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
541
543
|
*
|
|
542
|
-
* @param {
|
|
543
|
-
* @param {
|
|
544
|
+
* @param {*[]|Object|Function} array
|
|
545
|
+
* @param {*[]|Object|Function} values
|
|
544
546
|
* @returns {boolean}
|
|
545
547
|
*/
|
|
546
548
|
containsNoneCaseInsensitive: function containsNoneCaseInsensitive(array, values) {
|
|
@@ -559,7 +561,7 @@ var LeUtils = {
|
|
|
559
561
|
/**
|
|
560
562
|
* Finds the first element in the given array or object that returns true from the callback, and returns an object with the index and value.
|
|
561
563
|
*
|
|
562
|
-
* @param {*[]|
|
|
564
|
+
* @param {*[]|Object|Function} elements
|
|
563
565
|
* @param {(value:*, index:*) => boolean|void} callback
|
|
564
566
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
565
567
|
* @returns {{index:*, value:*}|null}
|
|
@@ -581,7 +583,7 @@ var LeUtils = {
|
|
|
581
583
|
/**
|
|
582
584
|
* Finds the first element in the given array or object that returns true from the callback, and returns the index.
|
|
583
585
|
*
|
|
584
|
-
* @param {*[]|
|
|
586
|
+
* @param {*[]|Object|Function} elements
|
|
585
587
|
* @param {(value:*, index:*) => boolean|void} callback
|
|
586
588
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
587
589
|
* @returns {*|null}
|
|
@@ -594,7 +596,7 @@ var LeUtils = {
|
|
|
594
596
|
/**
|
|
595
597
|
* Finds the first element in the given array or object that returns true from the callback, and returns the value.
|
|
596
598
|
*
|
|
597
|
-
* @param {*[]|
|
|
599
|
+
* @param {*[]|Object|Function} elements
|
|
598
600
|
* @param {(value:*, index:*) => boolean|void} callback
|
|
599
601
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
600
602
|
* @returns {*|null}
|
|
@@ -1140,7 +1142,7 @@ var LeUtils = {
|
|
|
1140
1142
|
* ```
|
|
1141
1143
|
*
|
|
1142
1144
|
* @param {*} elements
|
|
1143
|
-
* @returns {[boolean, *[]|
|
|
1145
|
+
* @returns {[boolean, *[]|Object|Map, (value:*,index:*)=>void]}
|
|
1144
1146
|
*/
|
|
1145
1147
|
getEmptySimplifiedCollection: function getEmptySimplifiedCollection(elements) {
|
|
1146
1148
|
if (elements === null || typeof elements === 'undefined') {
|
|
@@ -1461,7 +1463,7 @@ var LeUtils = {
|
|
|
1461
1463
|
/**
|
|
1462
1464
|
* Returns true if the given object is empty, false otherwise.
|
|
1463
1465
|
*
|
|
1464
|
-
* @param {
|
|
1466
|
+
* @param {Object} obj
|
|
1465
1467
|
* @param [optionalSkipHasOwnPropertyCheck]
|
|
1466
1468
|
* @returns {boolean}
|
|
1467
1469
|
*/
|
|
@@ -1477,7 +1479,7 @@ var LeUtils = {
|
|
|
1477
1479
|
/**
|
|
1478
1480
|
* Returns the number of fields in the given object.
|
|
1479
1481
|
*
|
|
1480
|
-
* @param {
|
|
1482
|
+
* @param {Object} obj
|
|
1481
1483
|
* @param [optionalSkipHasOwnPropertyCheck]
|
|
1482
1484
|
* @returns {number}
|
|
1483
1485
|
*/
|
|
@@ -1772,7 +1774,7 @@ var LeUtils = {
|
|
|
1772
1774
|
* Allows you to do a fetch, with built-in retry and abort functionality.
|
|
1773
1775
|
*
|
|
1774
1776
|
* @param {string} url
|
|
1775
|
-
* @param {{retries?:number|null, delay?:number|((attempt:number)=>number)|null}|
|
|
1777
|
+
* @param {{retries?:number|null, delay?:number|((attempt:number)=>number)|null}|Object|null} [options]
|
|
1776
1778
|
* @returns {{then:Function, catch:Function, finally:Function, remove:Function, isRemoved:Function}}
|
|
1777
1779
|
*/
|
|
1778
1780
|
fetch: function (_fetch) {
|
|
@@ -3677,7 +3679,7 @@ var SerializableMap = /*#__PURE__*/function (_Map) {
|
|
|
3677
3679
|
/**
|
|
3678
3680
|
* Returns a JSON representation of the map.
|
|
3679
3681
|
*
|
|
3680
|
-
* @returns {
|
|
3682
|
+
* @returns {Object}
|
|
3681
3683
|
*/
|
|
3682
3684
|
function toJSON() {
|
|
3683
3685
|
return Object.fromEntries(this);
|