@lowentry/utils 1.19.3 → 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/LeUtils.d.ts +102 -103
- package/index.d.ts +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/LeUtils.js +2 -1
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,56 +15,56 @@ 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): {
|
|
@@ -74,51 +74,51 @@ export namespace LeUtils {
|
|
|
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;
|
package/index.js
CHANGED
|
@@ -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
|
*
|