@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/package.json
CHANGED
package/src/LeTypes.js
CHANGED
|
@@ -39,7 +39,7 @@ export const IS_OBJECT = (value) => (typeof value === 'object') && (value !== nu
|
|
|
39
39
|
* Ensures the given value is an object (returns an empty object if it's not).
|
|
40
40
|
*
|
|
41
41
|
* @param value
|
|
42
|
-
* @returns {
|
|
42
|
+
* @returns {Object}
|
|
43
43
|
*/
|
|
44
44
|
export const OBJECT = (value) => IS_OBJECT(value) ? value : {};
|
|
45
45
|
|
package/src/LeUtils.js
CHANGED
|
@@ -43,7 +43,8 @@ export const LeUtils = {
|
|
|
43
43
|
* @param {*} other The other value to compare.
|
|
44
44
|
* @returns {boolean} Returns true if the values are equivalent.
|
|
45
45
|
*/
|
|
46
|
-
equals:
|
|
46
|
+
equals:
|
|
47
|
+
(value, other) => FastDeepEqual(value, other),
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* Returns a deep copy of the given value.
|
|
@@ -215,7 +216,7 @@ export const LeUtils = {
|
|
|
215
216
|
*
|
|
216
217
|
* Values are compared by casting both of them to a string.
|
|
217
218
|
*
|
|
218
|
-
* @param {
|
|
219
|
+
* @param {*[]|Object|Function} array
|
|
219
220
|
* @param {*} value
|
|
220
221
|
* @returns {boolean}
|
|
221
222
|
*/
|
|
@@ -244,7 +245,7 @@ export const LeUtils = {
|
|
|
244
245
|
*
|
|
245
246
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
246
247
|
*
|
|
247
|
-
* @param {
|
|
248
|
+
* @param {*[]|Object|Function} array
|
|
248
249
|
* @param {*} value
|
|
249
250
|
* @returns {boolean}
|
|
250
251
|
*/
|
|
@@ -273,8 +274,8 @@ export const LeUtils = {
|
|
|
273
274
|
*
|
|
274
275
|
* Values are compared by casting both of them to a string.
|
|
275
276
|
*
|
|
276
|
-
* @param {
|
|
277
|
-
* @param {
|
|
277
|
+
* @param {*[]|Object|Function} array
|
|
278
|
+
* @param {*[]|Object|Function} values
|
|
278
279
|
* @returns {boolean}
|
|
279
280
|
*/
|
|
280
281
|
containsAll:
|
|
@@ -301,8 +302,8 @@ export const LeUtils = {
|
|
|
301
302
|
*
|
|
302
303
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
303
304
|
*
|
|
304
|
-
* @param {
|
|
305
|
-
* @param {
|
|
305
|
+
* @param {*[]|Object|Function} array
|
|
306
|
+
* @param {*[]|Object|Function} values
|
|
306
307
|
* @returns {boolean}
|
|
307
308
|
*/
|
|
308
309
|
containsAllCaseInsensitive:
|
|
@@ -329,8 +330,8 @@ export const LeUtils = {
|
|
|
329
330
|
*
|
|
330
331
|
* Values are compared by casting both of them to a string.
|
|
331
332
|
*
|
|
332
|
-
* @param {
|
|
333
|
-
* @param {
|
|
333
|
+
* @param {*[]|Object|Function} array
|
|
334
|
+
* @param {*[]|Object|Function} values
|
|
334
335
|
* @returns {boolean}
|
|
335
336
|
*/
|
|
336
337
|
containsAny:
|
|
@@ -357,8 +358,8 @@ export const LeUtils = {
|
|
|
357
358
|
*
|
|
358
359
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
359
360
|
*
|
|
360
|
-
* @param {
|
|
361
|
-
* @param {
|
|
361
|
+
* @param {*[]|Object|Function} array
|
|
362
|
+
* @param {*[]|Object|Function} values
|
|
362
363
|
* @returns {boolean}
|
|
363
364
|
*/
|
|
364
365
|
containsAnyCaseInsensitive:
|
|
@@ -385,8 +386,8 @@ export const LeUtils = {
|
|
|
385
386
|
*
|
|
386
387
|
* Values are compared by casting both of them to a string.
|
|
387
388
|
*
|
|
388
|
-
* @param {
|
|
389
|
-
* @param {
|
|
389
|
+
* @param {*[]|Object|Function} array
|
|
390
|
+
* @param {*[]|Object|Function} values
|
|
390
391
|
* @returns {boolean}
|
|
391
392
|
*/
|
|
392
393
|
containsNone:
|
|
@@ -413,8 +414,8 @@ export const LeUtils = {
|
|
|
413
414
|
*
|
|
414
415
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
415
416
|
*
|
|
416
|
-
* @param {
|
|
417
|
-
* @param {
|
|
417
|
+
* @param {*[]|Object|Function} array
|
|
418
|
+
* @param {*[]|Object|Function} values
|
|
418
419
|
* @returns {boolean}
|
|
419
420
|
*/
|
|
420
421
|
containsNoneCaseInsensitive:
|
|
@@ -439,7 +440,7 @@ export const LeUtils = {
|
|
|
439
440
|
/**
|
|
440
441
|
* 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.
|
|
441
442
|
*
|
|
442
|
-
* @param {*[]|
|
|
443
|
+
* @param {*[]|Object|Function} elements
|
|
443
444
|
* @param {(value:*, index:*) => boolean|void} callback
|
|
444
445
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
445
446
|
* @returns {{index:*, value:*}|null}
|
|
@@ -462,7 +463,7 @@ export const LeUtils = {
|
|
|
462
463
|
/**
|
|
463
464
|
* Finds the first element in the given array or object that returns true from the callback, and returns the index.
|
|
464
465
|
*
|
|
465
|
-
* @param {*[]|
|
|
466
|
+
* @param {*[]|Object|Function} elements
|
|
466
467
|
* @param {(value:*, index:*) => boolean|void} callback
|
|
467
468
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
468
469
|
* @returns {*|null}
|
|
@@ -473,7 +474,7 @@ export const LeUtils = {
|
|
|
473
474
|
/**
|
|
474
475
|
* Finds the first element in the given array or object that returns true from the callback, and returns the value.
|
|
475
476
|
*
|
|
476
|
-
* @param {*[]|
|
|
477
|
+
* @param {*[]|Object|Function} elements
|
|
477
478
|
* @param {(value:*, index:*) => boolean|void} callback
|
|
478
479
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
479
480
|
* @returns {*|null}
|
|
@@ -790,7 +791,7 @@ export const LeUtils = {
|
|
|
790
791
|
* ```
|
|
791
792
|
*
|
|
792
793
|
* @param {*} elements
|
|
793
|
-
* @returns {[boolean, *[]|
|
|
794
|
+
* @returns {[boolean, *[]|Object|Map, (value:*,index:*)=>void]}
|
|
794
795
|
*/
|
|
795
796
|
getEmptySimplifiedCollection:
|
|
796
797
|
(elements) =>
|
|
@@ -1186,7 +1187,7 @@ export const LeUtils = {
|
|
|
1186
1187
|
/**
|
|
1187
1188
|
* Returns true if the given object is empty, false otherwise.
|
|
1188
1189
|
*
|
|
1189
|
-
* @param {
|
|
1190
|
+
* @param {Object} obj
|
|
1190
1191
|
* @param [optionalSkipHasOwnPropertyCheck]
|
|
1191
1192
|
* @returns {boolean}
|
|
1192
1193
|
*/
|
|
@@ -1206,7 +1207,7 @@ export const LeUtils = {
|
|
|
1206
1207
|
/**
|
|
1207
1208
|
* Returns the number of fields in the given object.
|
|
1208
1209
|
*
|
|
1209
|
-
* @param {
|
|
1210
|
+
* @param {Object} obj
|
|
1210
1211
|
* @param [optionalSkipHasOwnPropertyCheck]
|
|
1211
1212
|
* @returns {number}
|
|
1212
1213
|
*/
|
|
@@ -1573,7 +1574,7 @@ export const LeUtils = {
|
|
|
1573
1574
|
* Allows you to do a fetch, with built-in retry and abort functionality.
|
|
1574
1575
|
*
|
|
1575
1576
|
* @param {string} url
|
|
1576
|
-
* @param {{retries?:number|null, delay?:number|((attempt:number)=>number)|null}|
|
|
1577
|
+
* @param {{retries?:number|null, delay?:number|((attempt:number)=>number)|null}|Object|null} [options]
|
|
1577
1578
|
* @returns {{then:Function, catch:Function, finally:Function, remove:Function, isRemoved:Function}}
|
|
1578
1579
|
*/
|
|
1579
1580
|
fetch:
|