@lowentry/utils 1.19.2 → 1.19.3
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 +15 -15
- package/build/classes/SerializableMap.d.ts +2 -2
- package/index.d.ts +18 -18
- package/index.js +23 -23
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/LeTypes.js +1 -1
- package/src/LeUtils.js +21 -21
- 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
|
@@ -215,7 +215,7 @@ export const LeUtils = {
|
|
|
215
215
|
*
|
|
216
216
|
* Values are compared by casting both of them to a string.
|
|
217
217
|
*
|
|
218
|
-
* @param {
|
|
218
|
+
* @param {*[]|Object|Function} array
|
|
219
219
|
* @param {*} value
|
|
220
220
|
* @returns {boolean}
|
|
221
221
|
*/
|
|
@@ -244,7 +244,7 @@ export const LeUtils = {
|
|
|
244
244
|
*
|
|
245
245
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
246
246
|
*
|
|
247
|
-
* @param {
|
|
247
|
+
* @param {*[]|Object|Function} array
|
|
248
248
|
* @param {*} value
|
|
249
249
|
* @returns {boolean}
|
|
250
250
|
*/
|
|
@@ -273,8 +273,8 @@ export const LeUtils = {
|
|
|
273
273
|
*
|
|
274
274
|
* Values are compared by casting both of them to a string.
|
|
275
275
|
*
|
|
276
|
-
* @param {
|
|
277
|
-
* @param {
|
|
276
|
+
* @param {*[]|Object|Function} array
|
|
277
|
+
* @param {*[]|Object|Function} values
|
|
278
278
|
* @returns {boolean}
|
|
279
279
|
*/
|
|
280
280
|
containsAll:
|
|
@@ -301,8 +301,8 @@ export const LeUtils = {
|
|
|
301
301
|
*
|
|
302
302
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
303
303
|
*
|
|
304
|
-
* @param {
|
|
305
|
-
* @param {
|
|
304
|
+
* @param {*[]|Object|Function} array
|
|
305
|
+
* @param {*[]|Object|Function} values
|
|
306
306
|
* @returns {boolean}
|
|
307
307
|
*/
|
|
308
308
|
containsAllCaseInsensitive:
|
|
@@ -329,8 +329,8 @@ export const LeUtils = {
|
|
|
329
329
|
*
|
|
330
330
|
* Values are compared by casting both of them to a string.
|
|
331
331
|
*
|
|
332
|
-
* @param {
|
|
333
|
-
* @param {
|
|
332
|
+
* @param {*[]|Object|Function} array
|
|
333
|
+
* @param {*[]|Object|Function} values
|
|
334
334
|
* @returns {boolean}
|
|
335
335
|
*/
|
|
336
336
|
containsAny:
|
|
@@ -357,8 +357,8 @@ export const LeUtils = {
|
|
|
357
357
|
*
|
|
358
358
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
359
359
|
*
|
|
360
|
-
* @param {
|
|
361
|
-
* @param {
|
|
360
|
+
* @param {*[]|Object|Function} array
|
|
361
|
+
* @param {*[]|Object|Function} values
|
|
362
362
|
* @returns {boolean}
|
|
363
363
|
*/
|
|
364
364
|
containsAnyCaseInsensitive:
|
|
@@ -385,8 +385,8 @@ export const LeUtils = {
|
|
|
385
385
|
*
|
|
386
386
|
* Values are compared by casting both of them to a string.
|
|
387
387
|
*
|
|
388
|
-
* @param {
|
|
389
|
-
* @param {
|
|
388
|
+
* @param {*[]|Object|Function} array
|
|
389
|
+
* @param {*[]|Object|Function} values
|
|
390
390
|
* @returns {boolean}
|
|
391
391
|
*/
|
|
392
392
|
containsNone:
|
|
@@ -413,8 +413,8 @@ export const LeUtils = {
|
|
|
413
413
|
*
|
|
414
414
|
* Values are compared by casting both of them to a string, and then lowercasing them.
|
|
415
415
|
*
|
|
416
|
-
* @param {
|
|
417
|
-
* @param {
|
|
416
|
+
* @param {*[]|Object|Function} array
|
|
417
|
+
* @param {*[]|Object|Function} values
|
|
418
418
|
* @returns {boolean}
|
|
419
419
|
*/
|
|
420
420
|
containsNoneCaseInsensitive:
|
|
@@ -439,7 +439,7 @@ export const LeUtils = {
|
|
|
439
439
|
/**
|
|
440
440
|
* 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
441
|
*
|
|
442
|
-
* @param {*[]|
|
|
442
|
+
* @param {*[]|Object|Function} elements
|
|
443
443
|
* @param {(value:*, index:*) => boolean|void} callback
|
|
444
444
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
445
445
|
* @returns {{index:*, value:*}|null}
|
|
@@ -462,7 +462,7 @@ export const LeUtils = {
|
|
|
462
462
|
/**
|
|
463
463
|
* Finds the first element in the given array or object that returns true from the callback, and returns the index.
|
|
464
464
|
*
|
|
465
|
-
* @param {*[]|
|
|
465
|
+
* @param {*[]|Object|Function} elements
|
|
466
466
|
* @param {(value:*, index:*) => boolean|void} callback
|
|
467
467
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
468
468
|
* @returns {*|null}
|
|
@@ -473,7 +473,7 @@ export const LeUtils = {
|
|
|
473
473
|
/**
|
|
474
474
|
* Finds the first element in the given array or object that returns true from the callback, and returns the value.
|
|
475
475
|
*
|
|
476
|
-
* @param {*[]|
|
|
476
|
+
* @param {*[]|Object|Function} elements
|
|
477
477
|
* @param {(value:*, index:*) => boolean|void} callback
|
|
478
478
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
479
479
|
* @returns {*|null}
|
|
@@ -790,7 +790,7 @@ export const LeUtils = {
|
|
|
790
790
|
* ```
|
|
791
791
|
*
|
|
792
792
|
* @param {*} elements
|
|
793
|
-
* @returns {[boolean, *[]|
|
|
793
|
+
* @returns {[boolean, *[]|Object|Map, (value:*,index:*)=>void]}
|
|
794
794
|
*/
|
|
795
795
|
getEmptySimplifiedCollection:
|
|
796
796
|
(elements) =>
|
|
@@ -1186,7 +1186,7 @@ export const LeUtils = {
|
|
|
1186
1186
|
/**
|
|
1187
1187
|
* Returns true if the given object is empty, false otherwise.
|
|
1188
1188
|
*
|
|
1189
|
-
* @param {
|
|
1189
|
+
* @param {Object} obj
|
|
1190
1190
|
* @param [optionalSkipHasOwnPropertyCheck]
|
|
1191
1191
|
* @returns {boolean}
|
|
1192
1192
|
*/
|
|
@@ -1206,7 +1206,7 @@ export const LeUtils = {
|
|
|
1206
1206
|
/**
|
|
1207
1207
|
* Returns the number of fields in the given object.
|
|
1208
1208
|
*
|
|
1209
|
-
* @param {
|
|
1209
|
+
* @param {Object} obj
|
|
1210
1210
|
* @param [optionalSkipHasOwnPropertyCheck]
|
|
1211
1211
|
* @returns {number}
|
|
1212
1212
|
*/
|
|
@@ -1573,7 +1573,7 @@ export const LeUtils = {
|
|
|
1573
1573
|
* Allows you to do a fetch, with built-in retry and abort functionality.
|
|
1574
1574
|
*
|
|
1575
1575
|
* @param {string} url
|
|
1576
|
-
* @param {{retries?:number|null, delay?:number|((attempt:number)=>number)|null}|
|
|
1576
|
+
* @param {{retries?:number|null, delay?:number|((attempt:number)=>number)|null}|Object|null} [options]
|
|
1577
1577
|
* @returns {{then:Function, catch:Function, finally:Function, remove:Function, isRemoved:Function}}
|
|
1578
1578
|
*/
|
|
1579
1579
|
fetch:
|