@oscarpalmer/atoms 0.203.0 → 0.204.1
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/array/filter.mjs +0 -1
- package/dist/array/find.mjs +0 -1
- package/dist/array/first.mjs +0 -1
- package/dist/array/group-by.mjs +0 -1
- package/dist/array/last.mjs +0 -1
- package/dist/array/move.mjs +0 -4
- package/dist/array/select.mjs +0 -1
- package/dist/array/sort.mjs +6 -15
- package/dist/array/swap.mjs +0 -1
- package/dist/array/to-map.mjs +0 -1
- package/dist/array/to-record.mjs +0 -1
- package/dist/beacon.mjs +36 -36
- package/dist/color/instance.mjs +42 -84
- package/dist/color/misc/alpha.d.mts +3 -1
- package/dist/color/misc/alpha.mjs +8 -2
- package/dist/color/misc/is.mjs +5 -4
- package/dist/color/misc/state.d.mts +29 -4
- package/dist/color/misc/state.mjs +18 -40
- package/dist/color/space/hex.d.mts +5 -1
- package/dist/color/space/hex.mjs +21 -2
- package/dist/color/space/hsl.d.mts +6 -2
- package/dist/color/space/hsl.mjs +25 -4
- package/dist/color/space/hwb.d.mts +6 -2
- package/dist/color/space/hwb.mjs +24 -3
- package/dist/color/space/rgb.d.mts +6 -2
- package/dist/color/space/rgb.mjs +41 -20
- package/dist/function/limit.mjs +0 -2
- package/dist/function/once.mjs +30 -36
- package/dist/function/retry.mjs +0 -1
- package/dist/index.d.mts +19 -5
- package/dist/index.mjs +498 -548
- package/dist/internal/{abort.d.mts → aborter.d.mts} +1 -1
- package/dist/internal/{abort.mjs → aborter.mjs} +1 -1
- package/dist/internal/array/get.mjs +3 -2
- package/dist/internal/array/index-of.mjs +0 -1
- package/dist/internal/function/assert.d.mts +1 -1
- package/dist/internal/function/assert.mjs +0 -7
- package/dist/internal/function/limit.mjs +10 -14
- package/dist/internal/function/memoize.mjs +22 -20
- package/dist/internal/function/work.mjs +0 -2
- package/dist/internal/herald.mjs +14 -15
- package/dist/internal/result/misc.mjs +2 -5
- package/dist/internal/subscription.mjs +24 -22
- package/dist/internal/value/compare.d.mts +1 -1
- package/dist/internal/value/compare.mjs +0 -5
- package/dist/internal/value/equal.d.mts +1 -1
- package/dist/internal/value/equal.mjs +4 -12
- package/dist/internal/value/handlers.d.mts +1 -1
- package/dist/internal/value/handlers.mjs +5 -7
- package/dist/internal/value/has.mjs +0 -1
- package/dist/internal/value/misc.d.mts +1 -1
- package/dist/internal/value/misc.mjs +4 -3
- package/dist/internal/value/partial.mjs +2 -1
- package/dist/internal/value/set.mjs +2 -1
- package/dist/is.d.mts +2 -2
- package/dist/is.mjs +2 -2
- package/dist/logger.mjs +46 -45
- package/dist/promise/delay.mjs +1 -1
- package/dist/promise/helpers.mjs +4 -3
- package/dist/promise/index.mjs +1 -2
- package/dist/promise/misc.d.mts +1 -1
- package/dist/promise/models.d.mts +1 -1
- package/dist/promise/timed.mjs +1 -1
- package/dist/queue.mjs +86 -80
- package/dist/result/index.mjs +0 -1
- package/dist/result/match.mjs +0 -1
- package/dist/result/work/flow.mjs +0 -1
- package/dist/result/work/pipe.mjs +0 -1
- package/dist/string/fuzzy.mjs +18 -21
- package/dist/string/normalize.mjs +2 -3
- package/dist/string/template.mjs +2 -3
- package/dist/value/clone.d.mts +1 -1
- package/dist/value/clone.mjs +4 -12
- package/dist/value/freeze.mjs +0 -4
- package/dist/value/merge.mjs +5 -7
- package/dist/value/transform.mjs +1 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -114,7 +114,6 @@ function filter(array, ...parameters) {
|
|
|
114
114
|
return findValues("all", array, parameters).matched;
|
|
115
115
|
}
|
|
116
116
|
filter.remove = exclude;
|
|
117
|
-
Object.defineProperty(filter, "remove", { value: exclude });
|
|
118
117
|
//#endregion
|
|
119
118
|
//#region src/array/first.ts
|
|
120
119
|
function first(array, ...parameters) {
|
|
@@ -124,7 +123,6 @@ function firstOrDefault(array, defaultValue, ...parameters) {
|
|
|
124
123
|
return findAbsoluteValueOrDefault(array, parameters, defaultValue, true, false);
|
|
125
124
|
}
|
|
126
125
|
first.default = firstOrDefault;
|
|
127
|
-
Object.defineProperty(first, "default", { value: firstOrDefault });
|
|
128
126
|
//#endregion
|
|
129
127
|
//#region src/internal/array/group.ts
|
|
130
128
|
function groupValues(array, key, value, arrays) {
|
|
@@ -153,7 +151,6 @@ function groupArraysBy(array, first, second) {
|
|
|
153
151
|
return groupValues(array, first, second, true);
|
|
154
152
|
}
|
|
155
153
|
groupBy.arrays = groupArraysBy;
|
|
156
|
-
Object.defineProperty(groupBy, "arrays", { value: groupArraysBy });
|
|
157
154
|
//#endregion
|
|
158
155
|
//#region src/internal/array/chunk.ts
|
|
159
156
|
/**
|
|
@@ -300,6 +297,15 @@ function isNonPrimitive(value) {
|
|
|
300
297
|
return !isPrimitive(value);
|
|
301
298
|
}
|
|
302
299
|
/**
|
|
300
|
+
* Is the value not a template strings array?
|
|
301
|
+
*
|
|
302
|
+
* @param value Value to check
|
|
303
|
+
* @returns `true` if the value is not a `TemplateStringsArray`, otherwise `false`
|
|
304
|
+
*/
|
|
305
|
+
function isNonTemplateStringsArray(value) {
|
|
306
|
+
return !isTemplateStringsArray(value);
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
303
309
|
* Is the value not a typed array?
|
|
304
310
|
*
|
|
305
311
|
* @param value Value to check
|
|
@@ -379,13 +385,14 @@ function getArray(value, indiced) {
|
|
|
379
385
|
if (value instanceof Set) return [...value.values()];
|
|
380
386
|
if (isNonPlainObject(value)) return [value];
|
|
381
387
|
if (indiced !== true) return Object.entries(value);
|
|
382
|
-
const
|
|
388
|
+
const obj = value;
|
|
389
|
+
const keys = Object.keys(obj);
|
|
383
390
|
const { length } = keys;
|
|
384
391
|
const array = [];
|
|
385
392
|
for (let index = 0; index < length; index += 1) {
|
|
386
393
|
const key = keys[index];
|
|
387
394
|
const asNumber = Number.parseInt(key, 10);
|
|
388
|
-
if (!Number.isNaN(asNumber)) array[asNumber] =
|
|
395
|
+
if (!Number.isNaN(asNumber)) array[asNumber] = obj[key];
|
|
389
396
|
}
|
|
390
397
|
return array;
|
|
391
398
|
}
|
|
@@ -398,7 +405,6 @@ function lastIndexOf(array, ...parameters) {
|
|
|
398
405
|
return findValue(FIND_VALUE_INDEX, array, parameters, true);
|
|
399
406
|
}
|
|
400
407
|
indexOf.last = lastIndexOf;
|
|
401
|
-
Object.defineProperty(indexOf, "last", { value: lastIndexOf });
|
|
402
408
|
//#endregion
|
|
403
409
|
//#region src/internal/array/match.ts
|
|
404
410
|
function endsWithArray(haystack, needle, key) {
|
|
@@ -553,7 +559,6 @@ function findLast(array, ...parameters) {
|
|
|
553
559
|
return findValue(FIND_VALUE_ITEM, array, parameters, true);
|
|
554
560
|
}
|
|
555
561
|
find.last = findLast;
|
|
556
|
-
Object.defineProperty(find, "last", { value: findLast });
|
|
557
562
|
//#endregion
|
|
558
563
|
//#region src/array/flatten.ts
|
|
559
564
|
/**
|
|
@@ -689,7 +694,6 @@ function selectValues(array, parameters) {
|
|
|
689
694
|
}).matched;
|
|
690
695
|
}
|
|
691
696
|
select.reverse = reverseSelect;
|
|
692
|
-
Object.defineProperty(select, "reverse", { value: reverseSelect });
|
|
693
697
|
//#endregion
|
|
694
698
|
//#region src/array/single.ts
|
|
695
699
|
function single(array, ...parameters) {
|
|
@@ -818,7 +822,6 @@ function lastOrDefault(array, defaultValue, ...parameters) {
|
|
|
818
822
|
return findAbsoluteValueOrDefault(array, parameters, defaultValue, true, true);
|
|
819
823
|
}
|
|
820
824
|
last.default = lastOrDefault;
|
|
821
|
-
Object.defineProperty(last, "default", { value: lastOrDefault });
|
|
822
825
|
//#endregion
|
|
823
826
|
//#region src/internal/array/overlap.ts
|
|
824
827
|
function arraysOverlap(first, second) {
|
|
@@ -912,10 +915,6 @@ function moveToIndex(array, value, index, key) {
|
|
|
912
915
|
}
|
|
913
916
|
move.indices = moveIndices;
|
|
914
917
|
move.toIndex = moveToIndex;
|
|
915
|
-
Object.defineProperties(move, {
|
|
916
|
-
indices: { value: moveIndices },
|
|
917
|
-
toIndex: { value: moveToIndex }
|
|
918
|
-
});
|
|
919
918
|
//#endregion
|
|
920
919
|
//#region src/internal/math/aggregate.ts
|
|
921
920
|
function aggregate(type, array, key, first) {
|
|
@@ -1074,19 +1073,17 @@ function BaseHandler(owner, options) {
|
|
|
1074
1073
|
this.owner = owner;
|
|
1075
1074
|
this.options = options;
|
|
1076
1075
|
}
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
register: { value: registerHandler }
|
|
1081
|
-
});
|
|
1076
|
+
BaseHandler.prototype.deregister = deregisterHandler;
|
|
1077
|
+
BaseHandler.prototype.get = getHandler$1;
|
|
1078
|
+
BaseHandler.prototype.register = registerHandler;
|
|
1082
1079
|
function CompareHandler(base) {
|
|
1083
1080
|
this.base = base;
|
|
1084
1081
|
}
|
|
1085
|
-
|
|
1082
|
+
CompareHandler.prototype.handle = handleComparison;
|
|
1086
1083
|
function ValueHandler(value) {
|
|
1087
1084
|
this.base = value;
|
|
1088
1085
|
}
|
|
1089
|
-
|
|
1086
|
+
ValueHandler.prototype.handle = handleValue$1;
|
|
1090
1087
|
function createBaseHandler(owner, options) {
|
|
1091
1088
|
return new BaseHandler(owner, options);
|
|
1092
1089
|
}
|
|
@@ -1207,23 +1204,14 @@ const compareHandler = createCompareHandler(compare, {
|
|
|
1207
1204
|
compare.deregister = deregisterComparator;
|
|
1208
1205
|
compare.handler = compareHandler;
|
|
1209
1206
|
compare.register = registerComparator;
|
|
1210
|
-
Object.defineProperties(compare, {
|
|
1211
|
-
deregister: { value: deregisterComparator },
|
|
1212
|
-
handler: { value: compareHandler },
|
|
1213
|
-
register: { value: registerComparator }
|
|
1214
|
-
});
|
|
1215
1207
|
//#endregion
|
|
1216
1208
|
//#region src/array/sort.ts
|
|
1217
|
-
const SORTER_PROPERTY = "$sorter";
|
|
1218
1209
|
function Sorter(sorters) {
|
|
1219
|
-
|
|
1210
|
+
this[SORTER_SYMBOL] = sorters;
|
|
1220
1211
|
}
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
is: { value: isSortedArray },
|
|
1225
|
-
sort: { value: sortArray }
|
|
1226
|
-
});
|
|
1212
|
+
Sorter.prototype.index = getSortedArrayIndex;
|
|
1213
|
+
Sorter.prototype.is = isSortedArray;
|
|
1214
|
+
Sorter.prototype.sort = sortArray;
|
|
1227
1215
|
function getComparisonSorter(callback, modifier) {
|
|
1228
1216
|
return {
|
|
1229
1217
|
modifier,
|
|
@@ -1235,7 +1223,7 @@ function getComparisonSorter(callback, modifier) {
|
|
|
1235
1223
|
function getComparisonValue(first, second, sorters, length) {
|
|
1236
1224
|
for (let index = 0; index < length; index += 1) {
|
|
1237
1225
|
const sorter = sorters[index];
|
|
1238
|
-
const values = [sorter.get ? sorter.value(first) : first, sorter.get ? sorter.value(second) : second];
|
|
1226
|
+
const values = [sorter.get ? sorter.value?.(first) : first, sorter.get ? sorter.value?.(second) : second];
|
|
1239
1227
|
const comparison = (sorter.comparison?.complex?.(first, values[0], second, values[1]) ?? sorter.comparison?.simple?.(values[0], values[1]) ?? compare(values[0], values[1])) * sorter.modifier;
|
|
1240
1228
|
if (comparison !== 0) return comparison;
|
|
1241
1229
|
}
|
|
@@ -1350,7 +1338,7 @@ const SORT_PEEK_PERCENTAGE = 10;
|
|
|
1350
1338
|
const SORT_THRESHOLD = 100;
|
|
1351
1339
|
const SORT_DIRECTION_ASCENDING = "ascending";
|
|
1352
1340
|
const SORT_DIRECTION_DESCENDING = "descending";
|
|
1353
|
-
const SORTER_SYMBOL = Symbol(
|
|
1341
|
+
const SORTER_SYMBOL = Symbol("sorter");
|
|
1354
1342
|
const modifiers = {
|
|
1355
1343
|
[SORT_DIRECTION_ASCENDING]: 1,
|
|
1356
1344
|
[SORT_DIRECTION_DESCENDING]: -1
|
|
@@ -1358,11 +1346,6 @@ const modifiers = {
|
|
|
1358
1346
|
sort.getIndex = getSortedIndex;
|
|
1359
1347
|
sort.initialize = initializeSorter;
|
|
1360
1348
|
sort.is = isSorted;
|
|
1361
|
-
Object.defineProperties(sort, {
|
|
1362
|
-
getIndex: { value: getSortedIndex },
|
|
1363
|
-
initialize: { value: initializeSorter },
|
|
1364
|
-
is: { value: isSorted }
|
|
1365
|
-
});
|
|
1366
1349
|
//#endregion
|
|
1367
1350
|
//#region src/array/swap.ts
|
|
1368
1351
|
function swap(array, first, second, third) {
|
|
@@ -1420,7 +1403,6 @@ function swapValues(array, from, to, key) {
|
|
|
1420
1403
|
return swapIndices(array, first, second);
|
|
1421
1404
|
}
|
|
1422
1405
|
swap.indices = swapIndices;
|
|
1423
|
-
Object.defineProperty(swap, "indices", { value: swapIndices });
|
|
1424
1406
|
//#endregion
|
|
1425
1407
|
//#region src/array/to-map.ts
|
|
1426
1408
|
function getMapValues(array, first, second, arrays) {
|
|
@@ -1447,7 +1429,6 @@ function toMapArrays(array, first, second) {
|
|
|
1447
1429
|
return getMapValues(array, first, second, true);
|
|
1448
1430
|
}
|
|
1449
1431
|
toMap.arrays = toMapArrays;
|
|
1450
|
-
Object.defineProperty(toMap, "arrays", { value: toMapArrays });
|
|
1451
1432
|
//#endregion
|
|
1452
1433
|
//#region src/array/to-record.ts
|
|
1453
1434
|
function toRecord(array, first, second) {
|
|
@@ -1457,7 +1438,6 @@ function toRecordArrays(array, first, second) {
|
|
|
1457
1438
|
return groupValues(array, first, second, true);
|
|
1458
1439
|
}
|
|
1459
1440
|
toRecord.arrays = toRecordArrays;
|
|
1460
|
-
Object.defineProperty(toRecord, "arrays", { value: toRecordArrays });
|
|
1461
1441
|
//#endregion
|
|
1462
1442
|
//#region src/internal/function/misc.ts
|
|
1463
1443
|
/**
|
|
@@ -1478,33 +1458,29 @@ const LIMITER_NAME_ASYNC = "asyncLimiter";
|
|
|
1478
1458
|
const LIMITER_NAME_SYNC = "limiter";
|
|
1479
1459
|
const LIMITER_PROPERTY = "$limiter";
|
|
1480
1460
|
function AsyncLimiter(type, callback, time) {
|
|
1481
|
-
|
|
1461
|
+
this[LIMITER_SYMBOL] = {
|
|
1482
1462
|
callback,
|
|
1483
1463
|
type,
|
|
1484
1464
|
interval: getNumberOrDefault(time, 0),
|
|
1485
1465
|
parameters: [],
|
|
1486
1466
|
throttle: type === LIMITER_THROTTLE
|
|
1487
|
-
}
|
|
1467
|
+
};
|
|
1488
1468
|
}
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
run: { value: runAsyncLimiter }
|
|
1493
|
-
});
|
|
1469
|
+
AsyncLimiter.prototype[LIMITER_PROPERTY] = LIMITER_NAME_ASYNC;
|
|
1470
|
+
AsyncLimiter.prototype.cancel = cancelAsyncLimiter;
|
|
1471
|
+
AsyncLimiter.prototype.run = runAsyncLimiter;
|
|
1494
1472
|
function Limiter(type, callback, time) {
|
|
1495
|
-
|
|
1473
|
+
this[LIMITER_SYMBOL] = {
|
|
1496
1474
|
callback,
|
|
1497
1475
|
type,
|
|
1498
1476
|
interval: getNumberOrDefault(time, 0),
|
|
1499
1477
|
parameters: [],
|
|
1500
1478
|
throttle: type === LIMITER_THROTTLE
|
|
1501
|
-
}
|
|
1479
|
+
};
|
|
1502
1480
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
run: { value: runLimiter }
|
|
1507
|
-
});
|
|
1481
|
+
Limiter.prototype[LIMITER_PROPERTY] = LIMITER_NAME_SYNC;
|
|
1482
|
+
Limiter.prototype.cancel = cancelLimiter;
|
|
1483
|
+
Limiter.prototype.run = runLimiter;
|
|
1508
1484
|
function cancelAsyncLimiter() {
|
|
1509
1485
|
const state = this[LIMITER_SYMBOL];
|
|
1510
1486
|
if (state.timer != null) clearTimer(state.timer);
|
|
@@ -1636,8 +1612,6 @@ function throttle(callback, time) {
|
|
|
1636
1612
|
}
|
|
1637
1613
|
debounce.async = asyncDebounce;
|
|
1638
1614
|
throttle.async = asyncThrottle;
|
|
1639
|
-
Object.defineProperty(debounce, "async", { value: asyncDebounce });
|
|
1640
|
-
Object.defineProperty(throttle, "async", { value: asyncThrottle });
|
|
1641
1615
|
//#endregion
|
|
1642
1616
|
//#region src/internal/result/misc.ts
|
|
1643
1617
|
function error(value, original) {
|
|
@@ -1667,8 +1641,7 @@ function isResult(value) {
|
|
|
1667
1641
|
return isResultValue(value, true) || isResultValue(value, false);
|
|
1668
1642
|
}
|
|
1669
1643
|
function isResultValue(value, okValue) {
|
|
1670
|
-
|
|
1671
|
-
return value.ok === okValue && (okValue ? RESULT_PROPERTY_VALUE : RESULT_PROPERTY_ERROR) in value;
|
|
1644
|
+
return isPlainObject(value) && value.ok === okValue && (okValue ? RESULT_PROPERTY_VALUE : RESULT_PROPERTY_ERROR) in value;
|
|
1672
1645
|
}
|
|
1673
1646
|
/**
|
|
1674
1647
|
* Creates an ok result
|
|
@@ -1689,8 +1662,6 @@ const RESULT_PROPERTY_ERROR = "error";
|
|
|
1689
1662
|
const RESULT_PROPERTY_VALUE = "value";
|
|
1690
1663
|
error.is = isError;
|
|
1691
1664
|
ok.is = isOk;
|
|
1692
|
-
Object.defineProperty(error, "is", { value: isError });
|
|
1693
|
-
Object.defineProperty(ok, "is", { value: isOk });
|
|
1694
1665
|
//#endregion
|
|
1695
1666
|
//#region src/internal/value/misc.ts
|
|
1696
1667
|
function findKey(needle, haystack) {
|
|
@@ -1722,9 +1693,10 @@ function getPaths(path, lowercase) {
|
|
|
1722
1693
|
function handleValue(data, path, value, get, ignoreCase) {
|
|
1723
1694
|
if (typeof data === "object" && data !== null) {
|
|
1724
1695
|
if (ignoreKey(path)) return error(MISC_NESTED_MESSAGE_UNSAFE);
|
|
1725
|
-
const
|
|
1726
|
-
|
|
1727
|
-
|
|
1696
|
+
const dataObject = data;
|
|
1697
|
+
const key = ignoreCase ? findKey(path, dataObject) : path;
|
|
1698
|
+
if (get) return key in dataObject ? ok(dataObject[key]) : error(MISC_NESTED_MESSAGE_MISSING);
|
|
1699
|
+
dataObject[key] = typeof value === "function" ? value(dataObject[key]) : value;
|
|
1728
1700
|
}
|
|
1729
1701
|
if (get) return error(MISC_NESTED_MESSAGE_MISSING);
|
|
1730
1702
|
}
|
|
@@ -1744,7 +1716,6 @@ function hasValueResult(data, path, ignoreCase) {
|
|
|
1744
1716
|
return getNestedValue(data, path, ignoreCase === true);
|
|
1745
1717
|
}
|
|
1746
1718
|
hasValue.get = hasValueResult;
|
|
1747
|
-
Object.defineProperty(hasValue, "get", { value: hasValueResult });
|
|
1748
1719
|
//#endregion
|
|
1749
1720
|
//#region src/internal/function/assert.ts
|
|
1750
1721
|
/**
|
|
@@ -1839,20 +1810,13 @@ assert.defined = assertDefined;
|
|
|
1839
1810
|
assert.instanceOf = assertInstanceOf;
|
|
1840
1811
|
assert.is = assertIs;
|
|
1841
1812
|
assert.property = assertProperty;
|
|
1842
|
-
Object.defineProperties(assert, {
|
|
1843
|
-
condition: { value: assertCondition },
|
|
1844
|
-
defined: { value: assertDefined },
|
|
1845
|
-
instanceOf: { value: assertInstanceOf },
|
|
1846
|
-
is: { value: assertIs },
|
|
1847
|
-
property: { value: assertProperty }
|
|
1848
|
-
});
|
|
1849
1813
|
//#endregion
|
|
1850
1814
|
//#region src/function/once.ts
|
|
1851
1815
|
const ONCE_NAME_ASYNC = "asyncOnce";
|
|
1852
1816
|
const ONCE_NAME_SYNC = "once";
|
|
1853
1817
|
const ONCE_PROPERTY = "$once";
|
|
1854
1818
|
function AsyncOnce(callback) {
|
|
1855
|
-
|
|
1819
|
+
this[ONCE_SYMBOL] = {
|
|
1856
1820
|
callback,
|
|
1857
1821
|
called: false,
|
|
1858
1822
|
cleared: false,
|
|
@@ -1860,61 +1824,49 @@ function AsyncOnce(callback) {
|
|
|
1860
1824
|
finished: false,
|
|
1861
1825
|
items: [],
|
|
1862
1826
|
value: void 0
|
|
1863
|
-
}
|
|
1827
|
+
};
|
|
1864
1828
|
}
|
|
1829
|
+
AsyncOnce.prototype[ONCE_PROPERTY] = ONCE_NAME_ASYNC;
|
|
1830
|
+
AsyncOnce.prototype.clear = clearOnce;
|
|
1831
|
+
AsyncOnce.prototype.run = runOnceAsync;
|
|
1865
1832
|
Object.defineProperties(AsyncOnce.prototype, {
|
|
1866
|
-
[ONCE_PROPERTY]: { value: ONCE_NAME_ASYNC },
|
|
1867
1833
|
called: {
|
|
1868
1834
|
enumerable: true,
|
|
1869
|
-
get
|
|
1870
|
-
return this[ONCE_SYMBOL].called;
|
|
1871
|
-
}
|
|
1835
|
+
get: getOnceCalled
|
|
1872
1836
|
},
|
|
1873
|
-
clear: { value: clearOnce },
|
|
1874
1837
|
cleared: {
|
|
1875
1838
|
enumerable: true,
|
|
1876
|
-
get
|
|
1877
|
-
return this[ONCE_SYMBOL].cleared;
|
|
1878
|
-
}
|
|
1839
|
+
get: getOnceCleared
|
|
1879
1840
|
},
|
|
1880
1841
|
error: {
|
|
1881
1842
|
enumerable: true,
|
|
1882
|
-
get
|
|
1883
|
-
return this[ONCE_SYMBOL].error;
|
|
1884
|
-
}
|
|
1843
|
+
get: getAsyncOnceError
|
|
1885
1844
|
},
|
|
1886
1845
|
finished: {
|
|
1887
1846
|
enumerable: true,
|
|
1888
|
-
get
|
|
1889
|
-
|
|
1890
|
-
}
|
|
1891
|
-
},
|
|
1892
|
-
run: { value: runOnceAsync }
|
|
1847
|
+
get: getAsyncOnceFinished
|
|
1848
|
+
}
|
|
1893
1849
|
});
|
|
1894
1850
|
function Once(callback) {
|
|
1895
|
-
|
|
1851
|
+
this[ONCE_SYMBOL] = {
|
|
1896
1852
|
callback,
|
|
1897
1853
|
called: false,
|
|
1898
1854
|
cleared: false,
|
|
1899
1855
|
value: void 0
|
|
1900
|
-
}
|
|
1856
|
+
};
|
|
1901
1857
|
}
|
|
1858
|
+
Once.prototype[ONCE_PROPERTY] = ONCE_NAME_SYNC;
|
|
1859
|
+
Once.prototype.clear = clearOnce;
|
|
1860
|
+
Once.prototype.run = runOnce;
|
|
1902
1861
|
Object.defineProperties(Once.prototype, {
|
|
1903
|
-
[ONCE_PROPERTY]: { value: ONCE_NAME_SYNC },
|
|
1904
|
-
clear: { value: clearOnce },
|
|
1905
1862
|
called: {
|
|
1906
1863
|
enumerable: true,
|
|
1907
|
-
get
|
|
1908
|
-
return this[ONCE_SYMBOL].called;
|
|
1909
|
-
}
|
|
1864
|
+
get: getOnceCalled
|
|
1910
1865
|
},
|
|
1911
1866
|
cleared: {
|
|
1912
1867
|
enumerable: true,
|
|
1913
|
-
get
|
|
1914
|
-
|
|
1915
|
-
}
|
|
1916
|
-
},
|
|
1917
|
-
run: { value: runOnce }
|
|
1868
|
+
get: getOnceCleared
|
|
1869
|
+
}
|
|
1918
1870
|
});
|
|
1919
1871
|
/**
|
|
1920
1872
|
* Create an asynchronous function that can only be called once, rejecting or resolving the same result on subsequent calls
|
|
@@ -1935,6 +1887,18 @@ function clearOnce() {
|
|
|
1935
1887
|
state.cleared = true;
|
|
1936
1888
|
state.value = void 0;
|
|
1937
1889
|
}
|
|
1890
|
+
function getAsyncOnceError() {
|
|
1891
|
+
return this[ONCE_SYMBOL].error;
|
|
1892
|
+
}
|
|
1893
|
+
function getAsyncOnceFinished() {
|
|
1894
|
+
return this[ONCE_SYMBOL].finished;
|
|
1895
|
+
}
|
|
1896
|
+
function getOnceCalled() {
|
|
1897
|
+
return this[ONCE_SYMBOL].called;
|
|
1898
|
+
}
|
|
1899
|
+
function getOnceCleared() {
|
|
1900
|
+
return this[ONCE_SYMBOL].cleared;
|
|
1901
|
+
}
|
|
1938
1902
|
function handleOnceResult(state, value, error) {
|
|
1939
1903
|
state.error = error;
|
|
1940
1904
|
state.finished = true;
|
|
@@ -2016,12 +1980,6 @@ asyncOnce.is = isAsyncOnce;
|
|
|
2016
1980
|
once.async = asyncOnce;
|
|
2017
1981
|
once.is = isOnce;
|
|
2018
1982
|
once.isAsync = isAsyncOnce;
|
|
2019
|
-
Object.defineProperty(asyncOnce, "is", { value: isAsyncOnce });
|
|
2020
|
-
Object.defineProperties(once, {
|
|
2021
|
-
async: { value: asyncOnce },
|
|
2022
|
-
is: { value: isOnce },
|
|
2023
|
-
isAsync: { value: isAsyncOnce }
|
|
2024
|
-
});
|
|
2025
1983
|
//#endregion
|
|
2026
1984
|
//#region src/function/retry.ts
|
|
2027
1985
|
/**
|
|
@@ -2105,7 +2063,6 @@ const RETRY_ERROR_NAME = "RetryError";
|
|
|
2105
2063
|
const RETRY_MESSAGE_EXPECTATION = "Retry expected a function";
|
|
2106
2064
|
const RETRY_MESSAGE_FAILED = "Retry failed";
|
|
2107
2065
|
retry.async = asyncRetry;
|
|
2108
|
-
Object.defineProperty(retry, "async", { value: asyncRetry });
|
|
2109
2066
|
//#endregion
|
|
2110
2067
|
//#region src/internal/function/work.ts
|
|
2111
2068
|
function asyncFlow(...fns) {
|
|
@@ -2166,8 +2123,6 @@ const assertFlowFunctions = assert.condition((value) => Array.isArray(value) &&
|
|
|
2166
2123
|
const assertPipeFunctions = assert.condition((value) => Array.isArray(value) && value.every((item) => typeof item === "function"), WORK_MESSAGE_PIPE_ARRAY, TypeError);
|
|
2167
2124
|
flow.async = asyncFlow;
|
|
2168
2125
|
pipe.async = asyncPipe;
|
|
2169
|
-
Object.defineProperty(flow, "async", { value: asyncFlow });
|
|
2170
|
-
Object.defineProperty(pipe, "async", { value: asyncPipe });
|
|
2171
2126
|
//#endregion
|
|
2172
2127
|
//#region src/internal/number.ts
|
|
2173
2128
|
/**
|
|
@@ -2305,32 +2260,28 @@ var SizedMap = class extends Map {
|
|
|
2305
2260
|
};
|
|
2306
2261
|
//#endregion
|
|
2307
2262
|
//#region src/internal/function/memoize.ts
|
|
2308
|
-
const MEMOIZED_PROPERTY = "$memoized";
|
|
2309
2263
|
function Memoized(callback, options) {
|
|
2310
|
-
|
|
2264
|
+
this[MEMOIZED_SYMBOL] = {
|
|
2311
2265
|
options,
|
|
2312
2266
|
cache: new SizedMap(options.cacheSize),
|
|
2313
2267
|
getter: void 0
|
|
2314
|
-
}
|
|
2268
|
+
};
|
|
2315
2269
|
this[MEMOIZED_SYMBOL].getter = createGetter(this[MEMOIZED_SYMBOL], callback);
|
|
2316
|
-
Object.defineProperties(this, {
|
|
2317
|
-
maximum: {
|
|
2318
|
-
enumerable: true,
|
|
2319
|
-
get: () => this[MEMOIZED_SYMBOL].cache.maximum
|
|
2320
|
-
},
|
|
2321
|
-
size: {
|
|
2322
|
-
enumerable: true,
|
|
2323
|
-
get: () => this[MEMOIZED_SYMBOL].cache.size
|
|
2324
|
-
}
|
|
2325
|
-
});
|
|
2326
2270
|
}
|
|
2271
|
+
Memoized.prototype.clear = clearMemoized;
|
|
2272
|
+
Memoized.prototype.delete = deleteMemoizedValue;
|
|
2273
|
+
Memoized.prototype.get = getMemoizedValue;
|
|
2274
|
+
Memoized.prototype.has = hasMemoizedValue;
|
|
2275
|
+
Memoized.prototype.run = runMemoized;
|
|
2327
2276
|
Object.defineProperties(Memoized.prototype, {
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2277
|
+
maximum: {
|
|
2278
|
+
enumerable: true,
|
|
2279
|
+
get: getMemoizedMaximum
|
|
2280
|
+
},
|
|
2281
|
+
size: {
|
|
2282
|
+
enumerable: true,
|
|
2283
|
+
get: getMemoizedSize
|
|
2284
|
+
}
|
|
2334
2285
|
});
|
|
2335
2286
|
function clearMemoized() {
|
|
2336
2287
|
this[MEMOIZED_SYMBOL].cache.clear();
|
|
@@ -2354,6 +2305,12 @@ function createMemoizationOptions(input) {
|
|
|
2354
2305
|
cacheSize: getNumberOrDefault(cacheSize, MEMOIZED_CACHE_SIZE_DEFAULT)
|
|
2355
2306
|
};
|
|
2356
2307
|
}
|
|
2308
|
+
function getMemoizedMaximum() {
|
|
2309
|
+
return this[MEMOIZED_SYMBOL].cache.maximum;
|
|
2310
|
+
}
|
|
2311
|
+
function getMemoizedSize() {
|
|
2312
|
+
return this[MEMOIZED_SYMBOL].cache.size;
|
|
2313
|
+
}
|
|
2357
2314
|
function getMemoizedValue(key) {
|
|
2358
2315
|
return this[MEMOIZED_SYMBOL].cache.get(key);
|
|
2359
2316
|
}
|
|
@@ -2377,7 +2334,7 @@ function runMemoized(...parameters) {
|
|
|
2377
2334
|
const MEMOIZED_CACHE_SIZE_DEFAULT = 1024;
|
|
2378
2335
|
const MEMOIZED_CALLBACK = "Memoized requires a callback function";
|
|
2379
2336
|
const MEMOIZED_KEY_SEPARATOR = "_";
|
|
2380
|
-
const MEMOIZED_SYMBOL = Symbol(
|
|
2337
|
+
const MEMOIZED_SYMBOL = Symbol("memoized");
|
|
2381
2338
|
//#endregion
|
|
2382
2339
|
//#region src/internal/string/case.ts
|
|
2383
2340
|
/**
|
|
@@ -2516,13 +2473,11 @@ let memoizedUpperCase;
|
|
|
2516
2473
|
//#endregion
|
|
2517
2474
|
//#region src/internal/value/equal.ts
|
|
2518
2475
|
function Equalizer(options) {
|
|
2519
|
-
|
|
2476
|
+
this[EQUAL_SYMBOL] = options;
|
|
2520
2477
|
}
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
register: { value: registerEqualizer }
|
|
2525
|
-
});
|
|
2478
|
+
Equalizer.prototype.compare = compare$1;
|
|
2479
|
+
Equalizer.prototype.deregister = deregisterEqualizer;
|
|
2480
|
+
Equalizer.prototype.register = registerEqualizer;
|
|
2526
2481
|
function compare$1(first, second) {
|
|
2527
2482
|
return equalValue(first, second, this[EQUAL_SYMBOL]);
|
|
2528
2483
|
}
|
|
@@ -2695,12 +2650,6 @@ equal.deregister = deregisterEqualizer;
|
|
|
2695
2650
|
equal.handler = equalHandler;
|
|
2696
2651
|
equal.initialize = initializeEqualizer;
|
|
2697
2652
|
equal.register = registerEqualizer;
|
|
2698
|
-
Object.defineProperties(equal, {
|
|
2699
|
-
deregister: { value: deregisterEqualizer },
|
|
2700
|
-
handler: { value: equalHandler },
|
|
2701
|
-
initialize: { value: initializeEqualizer },
|
|
2702
|
-
register: { value: registerEqualizer }
|
|
2703
|
-
});
|
|
2704
2653
|
//#endregion
|
|
2705
2654
|
//#region src/internal/value/get.ts
|
|
2706
2655
|
function getValue(data, path, ignoreCase) {
|
|
@@ -2725,7 +2674,7 @@ function setValue(data, path, value, ignoreCase) {
|
|
|
2725
2674
|
handleValue(target, currentPath, value, false, shouldIgnoreCase);
|
|
2726
2675
|
break;
|
|
2727
2676
|
}
|
|
2728
|
-
let next = handleValue(target, currentPath, null, true, shouldIgnoreCase)
|
|
2677
|
+
let next = unwrap(handleValue(target, currentPath, null, true, shouldIgnoreCase), void 0);
|
|
2729
2678
|
if (typeof next !== "object" || next === null) {
|
|
2730
2679
|
const nextPath = paths[index + 1];
|
|
2731
2680
|
if (SET_EXPRESSION_INDEX.test(nextPath)) next = Array.from({ length: Number(nextPath) + 1 }, () => void 0);
|
|
@@ -2738,7 +2687,7 @@ function setValue(data, path, value, ignoreCase) {
|
|
|
2738
2687
|
}
|
|
2739
2688
|
const SET_EXPRESSION_INDEX = /^\d+$/;
|
|
2740
2689
|
//#endregion
|
|
2741
|
-
//#region src/internal/
|
|
2690
|
+
//#region src/internal/aborter.ts
|
|
2742
2691
|
function createAborter(value, onAbort) {
|
|
2743
2692
|
if (!(value instanceof AbortSignal)) return;
|
|
2744
2693
|
value.addEventListener(ABORT_EVENT, onAbort, ABORT_OPTIONS);
|
|
@@ -2805,7 +2754,7 @@ function createPromiseOptions(input) {
|
|
|
2805
2754
|
signal: input,
|
|
2806
2755
|
time: 0
|
|
2807
2756
|
};
|
|
2808
|
-
const options =
|
|
2757
|
+
const options = isPlainObject(input) ? input : {};
|
|
2809
2758
|
return {
|
|
2810
2759
|
signal: options.signal instanceof AbortSignal ? options.signal : void 0,
|
|
2811
2760
|
time: getNumberOrDefault(options.time, 0)
|
|
@@ -2817,7 +2766,7 @@ function createPromisesOptions(input) {
|
|
|
2817
2766
|
signal: input,
|
|
2818
2767
|
strategy: PROMISE_STRATEGY_DEFAULT
|
|
2819
2768
|
};
|
|
2820
|
-
const options =
|
|
2769
|
+
const options = isPlainObject(input) ? input : {};
|
|
2821
2770
|
return {
|
|
2822
2771
|
signal: options.signal instanceof AbortSignal ? options.signal : void 0,
|
|
2823
2772
|
strategy: getStrategyOrDefault(options.strategy)
|
|
@@ -2856,7 +2805,7 @@ function isRejected(value) {
|
|
|
2856
2805
|
return isType(value, PROMISE_TYPE_REJECTED);
|
|
2857
2806
|
}
|
|
2858
2807
|
function isType(value, type) {
|
|
2859
|
-
return
|
|
2808
|
+
return isPlainObject(value) && "status" in value && value.status === type;
|
|
2860
2809
|
}
|
|
2861
2810
|
//#endregion
|
|
2862
2811
|
//#region src/result/misc.ts
|
|
@@ -3026,7 +2975,6 @@ async function resultPromises(items, signal) {
|
|
|
3026
2975
|
return promises(items, signal).then(getResultsFromPromises);
|
|
3027
2976
|
}
|
|
3028
2977
|
promises.result = resultPromises;
|
|
3029
|
-
Object.defineProperty(promises, "result", { value: resultPromises });
|
|
3030
2978
|
//#endregion
|
|
3031
2979
|
//#region src/result/index.ts
|
|
3032
2980
|
async function asyncAttempt(value, err) {
|
|
@@ -3046,7 +2994,6 @@ function attempt(callback, err) {
|
|
|
3046
2994
|
}
|
|
3047
2995
|
}
|
|
3048
2996
|
attempt.async = asyncAttempt;
|
|
3049
|
-
Object.defineProperty(attempt, "async", { value: asyncAttempt });
|
|
3050
2997
|
//#endregion
|
|
3051
2998
|
//#region src/result/match.ts
|
|
3052
2999
|
async function asyncMatchResult(result, first, error) {
|
|
@@ -3072,7 +3019,6 @@ function matchResult(result, first, error) {
|
|
|
3072
3019
|
}
|
|
3073
3020
|
const MATCH_MESSAGE = "`result.match` expected a Result or a function that returns a Result";
|
|
3074
3021
|
matchResult.async = asyncMatchResult;
|
|
3075
|
-
Object.defineProperty(matchResult, "async", { value: asyncMatchResult });
|
|
3076
3022
|
//#endregion
|
|
3077
3023
|
//#region src/result/work/flow.ts
|
|
3078
3024
|
function attemptAsyncFlow(...fns) {
|
|
@@ -3096,7 +3042,6 @@ function attemptFlow(...fns) {
|
|
|
3096
3042
|
});
|
|
3097
3043
|
}
|
|
3098
3044
|
attemptFlow.async = attemptAsyncFlow;
|
|
3099
|
-
Object.defineProperty(attemptFlow, "async", { value: attemptAsyncFlow });
|
|
3100
3045
|
//#endregion
|
|
3101
3046
|
//#region src/result/work/pipe.ts
|
|
3102
3047
|
async function attemptAsyncPipe(initial, first, ...seconds) {
|
|
@@ -3116,7 +3061,6 @@ function attemptPipe(initial, first, ...seconds) {
|
|
|
3116
3061
|
});
|
|
3117
3062
|
}
|
|
3118
3063
|
attemptPipe.async = attemptAsyncPipe;
|
|
3119
|
-
Object.defineProperty(attemptPipe, "async", { value: attemptAsyncPipe });
|
|
3120
3064
|
//#endregion
|
|
3121
3065
|
//#region src/string/match.ts
|
|
3122
3066
|
/**
|
|
@@ -3169,27 +3113,24 @@ const matchMemoizers = {};
|
|
|
3169
3113
|
const FUZZY_PROPERTY = "$fuzzy";
|
|
3170
3114
|
const FUZZY_SYMBOL = Symbol(FUZZY_PROPERTY);
|
|
3171
3115
|
function Fuzzy(state) {
|
|
3172
|
-
|
|
3116
|
+
this[FUZZY_SYMBOL] = state;
|
|
3173
3117
|
}
|
|
3118
|
+
Fuzzy.prototype[FUZZY_PROPERTY] = true;
|
|
3119
|
+
Fuzzy.prototype.search = search;
|
|
3174
3120
|
Object.defineProperties(Fuzzy.prototype, {
|
|
3175
|
-
[FUZZY_PROPERTY]: { value: true },
|
|
3176
3121
|
items: {
|
|
3177
3122
|
enumerable: true,
|
|
3178
|
-
get
|
|
3179
|
-
|
|
3180
|
-
},
|
|
3181
|
-
set(value) {
|
|
3182
|
-
setItems(this[FUZZY_SYMBOL], value);
|
|
3183
|
-
}
|
|
3123
|
+
get: getFuzzyItems,
|
|
3124
|
+
set: setFuzzyItems
|
|
3184
3125
|
},
|
|
3185
|
-
search: { value: search },
|
|
3186
3126
|
strings: {
|
|
3187
3127
|
enumerable: true,
|
|
3188
|
-
get
|
|
3189
|
-
return this[FUZZY_SYMBOL].strings.slice();
|
|
3190
|
-
}
|
|
3128
|
+
get: getFuzzyStrings
|
|
3191
3129
|
}
|
|
3192
3130
|
});
|
|
3131
|
+
function createFuzzyItems(items) {
|
|
3132
|
+
return items.sort((first, second) => first.haystack.localeCompare(second.haystack)).map(({ item }) => item);
|
|
3133
|
+
}
|
|
3193
3134
|
function createFuzzyOptions(input, state) {
|
|
3194
3135
|
const options = isPlainObject(input) ? input : {};
|
|
3195
3136
|
const limit = typeof input === "number" ? input : options.limit;
|
|
@@ -3238,8 +3179,11 @@ function getHandler(input) {
|
|
|
3238
3179
|
throw new TypeError(FUZZY_MESSAGE_HANDLER);
|
|
3239
3180
|
}
|
|
3240
3181
|
}
|
|
3241
|
-
function getFuzzyItems(
|
|
3242
|
-
return items.
|
|
3182
|
+
function getFuzzyItems() {
|
|
3183
|
+
return this[FUZZY_SYMBOL].items.slice();
|
|
3184
|
+
}
|
|
3185
|
+
function getFuzzyStrings() {
|
|
3186
|
+
return this[FUZZY_SYMBOL].strings.slice();
|
|
3243
3187
|
}
|
|
3244
3188
|
function getScore(haystack, needle) {
|
|
3245
3189
|
if (!isSubsequence(haystack, needle)) return -1;
|
|
@@ -3334,16 +3278,17 @@ function search(input, option) {
|
|
|
3334
3278
|
for (let index = 0; index < length; index += 1) {
|
|
3335
3279
|
const key = keys[index];
|
|
3336
3280
|
if (maxScore - key > options.tolerance) break;
|
|
3337
|
-
similar.push(...
|
|
3281
|
+
similar.push(...createFuzzyItems(scored[key]));
|
|
3338
3282
|
}
|
|
3339
3283
|
}
|
|
3340
|
-
result.exact =
|
|
3284
|
+
result.exact = createFuzzyItems(options.limit == null ? exact : exact.slice(0, options.limit));
|
|
3341
3285
|
if (options.limit == null) result.similar = similar;
|
|
3342
3286
|
else result.similar = similar.slice(0, options.limit - result.exact.length);
|
|
3343
3287
|
return result;
|
|
3344
3288
|
}
|
|
3345
|
-
function
|
|
3289
|
+
function setFuzzyItems(value) {
|
|
3346
3290
|
if (!Array.isArray(value)) throw new TypeError(FUZZY_MESSAGE_ARRAY);
|
|
3291
|
+
const state = this[FUZZY_SYMBOL];
|
|
3347
3292
|
state.items = value.slice();
|
|
3348
3293
|
state.strings = value.map(state.handler);
|
|
3349
3294
|
}
|
|
@@ -3353,10 +3298,6 @@ const FUZZY_MESSAGE_HANDLER = "Fuzzy requires a key or function to stringify ite
|
|
|
3353
3298
|
const FUZZY_PROXIMITY_THRESHOLD = 5;
|
|
3354
3299
|
fuzzy.is = isFuzzy;
|
|
3355
3300
|
fuzzy.match = fuzzyMatch;
|
|
3356
|
-
Object.defineProperties(fuzzy, {
|
|
3357
|
-
is: { value: isFuzzy },
|
|
3358
|
-
match: { value: fuzzyMatch }
|
|
3359
|
-
});
|
|
3360
3301
|
//#endregion
|
|
3361
3302
|
//#region src/string/index.ts
|
|
3362
3303
|
function dedent(value, ...values) {
|
|
@@ -3454,9 +3395,9 @@ const STRING_ZERO = "0";
|
|
|
3454
3395
|
//#endregion
|
|
3455
3396
|
//#region src/string/normalize.ts
|
|
3456
3397
|
function Normalizer(options) {
|
|
3457
|
-
|
|
3398
|
+
this[NORMALIZE_SYMBOL] = options;
|
|
3458
3399
|
}
|
|
3459
|
-
|
|
3400
|
+
Normalizer.prototype.normalize = normalizeString;
|
|
3460
3401
|
function createNormalizeOptions(input) {
|
|
3461
3402
|
const options = isPlainObject(input) ? input : {};
|
|
3462
3403
|
return {
|
|
@@ -3559,13 +3500,12 @@ const NORMALIZE_WHITESPACE_PATTERN = /\s+/g;
|
|
|
3559
3500
|
const NORMALIZE_WHITESPACE_REPLACEMENT = " ";
|
|
3560
3501
|
let deburrMemoizer;
|
|
3561
3502
|
normalize.initialize = initializeNormalizer;
|
|
3562
|
-
Object.defineProperty(normalize, "initialize", { value: initializeNormalizer });
|
|
3563
3503
|
//#endregion
|
|
3564
3504
|
//#region src/string/template.ts
|
|
3565
3505
|
function Templater(options) {
|
|
3566
|
-
|
|
3506
|
+
this[TEMPLATE_SYMBOL] = options;
|
|
3567
3507
|
}
|
|
3568
|
-
|
|
3508
|
+
Templater.prototype.render = render;
|
|
3569
3509
|
function createTemplateOptions(input) {
|
|
3570
3510
|
const options = isPlainObject(input) ? input : {};
|
|
3571
3511
|
return {
|
|
@@ -3614,18 +3554,15 @@ function template(value, ...parameters) {
|
|
|
3614
3554
|
const TEMPLATE_EXPRESSION_VARIABLE = /{{([\s\S]+?)}}/g;
|
|
3615
3555
|
const TEMPLATE_SYMBOL = Symbol("template");
|
|
3616
3556
|
template.initialize = initializeTemplater;
|
|
3617
|
-
Object.defineProperty(template, "initialize", { value: initializeTemplater });
|
|
3618
3557
|
//#endregion
|
|
3619
3558
|
//#region src/value/clone.ts
|
|
3620
3559
|
const CLONE_NAME = "clone";
|
|
3621
3560
|
function Cloner(options) {
|
|
3622
|
-
|
|
3561
|
+
this[CLONE_SYMBOL] = options;
|
|
3623
3562
|
}
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
register: { value: registerCloner }
|
|
3628
|
-
});
|
|
3563
|
+
Cloner.prototype.clone = cloneFromCloner;
|
|
3564
|
+
Cloner.prototype.deregister = deregisterCloner;
|
|
3565
|
+
Cloner.prototype.register = registerCloner;
|
|
3629
3566
|
function clone(value, options) {
|
|
3630
3567
|
return cloneAny(value, { copy: false }, 0, options);
|
|
3631
3568
|
}
|
|
@@ -3809,12 +3746,6 @@ clone.deregister = deregisterCloner;
|
|
|
3809
3746
|
clone.handlers = cloneHandler;
|
|
3810
3747
|
clone.initialize = initializeCloner;
|
|
3811
3748
|
clone.register = registerCloner;
|
|
3812
|
-
Object.defineProperties(clone, {
|
|
3813
|
-
deregister: { value: deregisterCloner },
|
|
3814
|
-
handler: { value: cloneHandler },
|
|
3815
|
-
initialize: { value: initializeCloner },
|
|
3816
|
-
register: { value: registerCloner }
|
|
3817
|
-
});
|
|
3818
3749
|
//#endregion
|
|
3819
3750
|
//#region src/value/collection.ts
|
|
3820
3751
|
function inMap(map, value, key) {
|
|
@@ -4020,14 +3951,10 @@ function isFrozen(value) {
|
|
|
4020
3951
|
const frozenValues = /* @__PURE__ */ new WeakSet();
|
|
4021
3952
|
freeze.flat = flatFreeze;
|
|
4022
3953
|
freeze.is = isFrozen;
|
|
4023
|
-
Object.defineProperties(freeze, {
|
|
4024
|
-
flat: { value: flatFreeze },
|
|
4025
|
-
is: { value: isFrozen }
|
|
4026
|
-
});
|
|
4027
3954
|
//#endregion
|
|
4028
3955
|
//#region src/internal/value/partial.ts
|
|
4029
3956
|
function partial(value, providedKeys, omit) {
|
|
4030
|
-
if (
|
|
3957
|
+
if (!isPlainObject(value)) return {};
|
|
4031
3958
|
const keys = omit ? Object.keys(value) : Array.isArray(providedKeys) ? providedKeys : [];
|
|
4032
3959
|
const { length } = keys;
|
|
4033
3960
|
if (length === 0) return omit ? value : {};
|
|
@@ -4157,16 +4084,16 @@ function unsmush(value) {
|
|
|
4157
4084
|
//#endregion
|
|
4158
4085
|
//#region src/value/merge.ts
|
|
4159
4086
|
function Assigner(options) {
|
|
4160
|
-
|
|
4087
|
+
this[MERGE_SYMBOL_ASSIGN] = {
|
|
4161
4088
|
...options,
|
|
4162
4089
|
assignValues: true
|
|
4163
|
-
}
|
|
4090
|
+
};
|
|
4164
4091
|
}
|
|
4165
|
-
|
|
4092
|
+
Assigner.prototype.assign = assignFromAssigner;
|
|
4166
4093
|
function Merger(options) {
|
|
4167
|
-
|
|
4094
|
+
this[MERGE_SYMBOL_MERGE] = options;
|
|
4168
4095
|
}
|
|
4169
|
-
|
|
4096
|
+
Merger.prototype.merge = mergeFromMerger;
|
|
4170
4097
|
/**
|
|
4171
4098
|
* Assign values from one or more objects to the first one
|
|
4172
4099
|
*
|
|
@@ -4270,12 +4197,10 @@ const MERGE_SYMBOL_ASSIGN = Symbol("assign");
|
|
|
4270
4197
|
const MERGE_SYMBOL_MERGE = Symbol("merge");
|
|
4271
4198
|
assign.initialize = initializeAssigner;
|
|
4272
4199
|
merge.initialize = initializeMerger;
|
|
4273
|
-
Object.defineProperty(assign, "initialize", { value: initializeAssigner });
|
|
4274
|
-
Object.defineProperty(merge, "initialize", { value: initializeMerger });
|
|
4275
4200
|
//#endregion
|
|
4276
4201
|
//#region src/value/transform.ts
|
|
4277
4202
|
function Transformer(transformer) {
|
|
4278
|
-
|
|
4203
|
+
this[TRANSFORM_SYMBOL] = transformer;
|
|
4279
4204
|
}
|
|
4280
4205
|
Object.defineProperties(Transformer.prototype, { transform: { value: transformValue } });
|
|
4281
4206
|
function getTransformHandler(input) {
|
|
@@ -4313,47 +4238,38 @@ function transformValue(value) {
|
|
|
4313
4238
|
}
|
|
4314
4239
|
const TRANSFORM_SYMBOL = Symbol("transform");
|
|
4315
4240
|
transform.initialize = initializeTransformer;
|
|
4316
|
-
Object.defineProperty(transform, "initialize", { value: initializeTransformer });
|
|
4317
4241
|
//#endregion
|
|
4318
4242
|
//#region src/internal/subscription.ts
|
|
4319
4243
|
const SUBSCRIPTION_NAME = "subscription";
|
|
4320
4244
|
const SUBSCRIPTION_PROPERTY = "$subscription";
|
|
4321
4245
|
const SUBSCRIPTION_STORE = "subscriptions";
|
|
4322
4246
|
function Subscription(state, property, parameters) {
|
|
4323
|
-
|
|
4247
|
+
this[SUBSCRIPTION_SYMBOL] = state;
|
|
4248
|
+
this[property.key] = property.value;
|
|
4324
4249
|
state.aborter = createAborter(parameters.signal, () => this.unsubscribe(subscriptions, this, state));
|
|
4325
|
-
Object.defineProperties(this, {
|
|
4326
|
-
[property.key]: { value: property.value },
|
|
4327
|
-
active: {
|
|
4328
|
-
enumerable: true,
|
|
4329
|
-
get: () => (state.parameters?.isActive?.() ?? true) && state.active
|
|
4330
|
-
}
|
|
4331
|
-
});
|
|
4332
4250
|
addSubscription(this);
|
|
4333
4251
|
}
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4252
|
+
Subscription.prototype[SUBSCRIPTION_PROPERTY] = SUBSCRIPTION_NAME;
|
|
4253
|
+
Subscription.prototype.unsubscribe = removeSubscription;
|
|
4254
|
+
Object.defineProperty(Subscription.prototype, "active", {
|
|
4255
|
+
enumerable: true,
|
|
4256
|
+
get: getSubscriptionActive
|
|
4337
4257
|
});
|
|
4338
4258
|
function Subscriptions(parameters) {
|
|
4339
4259
|
const { keys, property } = createSubscriptionsParameters(parameters);
|
|
4340
|
-
|
|
4260
|
+
this[SUBSCRIPTION_SYMBOL] = createSubscriptionsState(property, keys);
|
|
4341
4261
|
}
|
|
4262
|
+
Subscriptions.prototype[SUBSCRIPTION_PROPERTY] = SUBSCRIPTION_STORE;
|
|
4263
|
+
Subscriptions.prototype.clear = clearSubscriptions;
|
|
4264
|
+
Subscriptions.prototype.create = createSubscription;
|
|
4342
4265
|
Object.defineProperties(Subscriptions.prototype, {
|
|
4343
|
-
[SUBSCRIPTION_PROPERTY]: { value: SUBSCRIPTION_STORE },
|
|
4344
|
-
clear: { value: clearSubscriptions },
|
|
4345
|
-
create: { value: createSubscription },
|
|
4346
4266
|
items: {
|
|
4347
4267
|
enumerable: true,
|
|
4348
|
-
get
|
|
4349
|
-
return this[SUBSCRIPTION_SYMBOL].items;
|
|
4350
|
-
}
|
|
4268
|
+
get: getSubscriptionsItems
|
|
4351
4269
|
},
|
|
4352
4270
|
values: {
|
|
4353
4271
|
enumerable: true,
|
|
4354
|
-
get
|
|
4355
|
-
return this[SUBSCRIPTION_SYMBOL].values;
|
|
4356
|
-
}
|
|
4272
|
+
get: getSubscriptionsValues
|
|
4357
4273
|
}
|
|
4358
4274
|
});
|
|
4359
4275
|
function addSubscription(instance) {
|
|
@@ -4416,6 +4332,16 @@ function getExistingSubscription(subscriptions, state) {
|
|
|
4416
4332
|
const { parameters } = state;
|
|
4417
4333
|
return isKey(parameters.key) ? values.from.keyed?.get(parameters.key)?.get(parameters.value) : values.from.any.get(parameters.value);
|
|
4418
4334
|
}
|
|
4335
|
+
function getSubscriptionActive() {
|
|
4336
|
+
const state = this[SUBSCRIPTION_SYMBOL];
|
|
4337
|
+
return (state.parameters?.isActive?.() ?? true) && state.active;
|
|
4338
|
+
}
|
|
4339
|
+
function getSubscriptionsItems() {
|
|
4340
|
+
return this[SUBSCRIPTION_SYMBOL].items;
|
|
4341
|
+
}
|
|
4342
|
+
function getSubscriptionsValues() {
|
|
4343
|
+
return this[SUBSCRIPTION_SYMBOL].values;
|
|
4344
|
+
}
|
|
4419
4345
|
function createSubscriptionParameters(input) {
|
|
4420
4346
|
const values = isPlainObject(input) ? input : {};
|
|
4421
4347
|
if (values.value == null) throw new Error(SUBSCRIPTION_INVALID_VALUE);
|
|
@@ -4534,54 +4460,43 @@ const BEACON_PROPERTY = "$beacon";
|
|
|
4534
4460
|
const BEACON_NAME = "beacon";
|
|
4535
4461
|
const BEACON_OBSERVABLE = "observable";
|
|
4536
4462
|
function Beacon(value, options) {
|
|
4537
|
-
|
|
4463
|
+
this[BEACON_SYMBOL] = {
|
|
4538
4464
|
value,
|
|
4539
4465
|
active: true,
|
|
4540
4466
|
options: createBeaconOptions(options)
|
|
4541
|
-
}
|
|
4467
|
+
};
|
|
4542
4468
|
}
|
|
4469
|
+
Beacon.prototype[BEACON_PROPERTY] = BEACON_NAME;
|
|
4470
|
+
Beacon.prototype.deactivate = deactivateBeacon;
|
|
4471
|
+
Beacon.prototype.emit = emitBeaconValue;
|
|
4472
|
+
Beacon.prototype.error = emitBeaconError;
|
|
4473
|
+
Beacon.prototype.finish = finishBeacon;
|
|
4543
4474
|
Object.defineProperties(Beacon.prototype, {
|
|
4544
|
-
[BEACON_PROPERTY]: { value: BEACON_NAME },
|
|
4545
4475
|
active: {
|
|
4546
4476
|
enumerable: true,
|
|
4547
|
-
get
|
|
4548
|
-
return this[BEACON_SYMBOL].active;
|
|
4549
|
-
}
|
|
4477
|
+
get: getBeaconActive
|
|
4550
4478
|
},
|
|
4551
|
-
deactivate: { value: deactivateBeacon },
|
|
4552
|
-
emit: { value: emitBeaconValue },
|
|
4553
|
-
error: { value: emitBeaconError },
|
|
4554
|
-
finish: { value: finishBeacon },
|
|
4555
4479
|
observable: {
|
|
4556
4480
|
enumerable: true,
|
|
4557
|
-
get
|
|
4558
|
-
return getObservable(this[BEACON_SYMBOL]);
|
|
4559
|
-
}
|
|
4481
|
+
get: getBeaconObservable
|
|
4560
4482
|
},
|
|
4561
4483
|
value: {
|
|
4562
4484
|
enumerable: true,
|
|
4563
|
-
get
|
|
4564
|
-
return this[BEACON_SYMBOL].value;
|
|
4565
|
-
}
|
|
4485
|
+
get: getBeaconValue
|
|
4566
4486
|
}
|
|
4567
4487
|
});
|
|
4568
4488
|
function Observable(beacon) {
|
|
4569
|
-
|
|
4489
|
+
this[BEACON_SYMBOL] = {
|
|
4570
4490
|
beacon,
|
|
4571
4491
|
active: beacon.active
|
|
4572
|
-
}
|
|
4492
|
+
};
|
|
4573
4493
|
}
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
return state.beacon.active && state.active;
|
|
4581
|
-
}
|
|
4582
|
-
},
|
|
4583
|
-
deactivate: { value: deactiveateObservable },
|
|
4584
|
-
subscribe: { value: subscribeToObservable }
|
|
4494
|
+
Observable.prototype[BEACON_PROPERTY] = BEACON_OBSERVABLE;
|
|
4495
|
+
Observable.prototype.deactivate = deactiveateObservable;
|
|
4496
|
+
Observable.prototype.subscribe = subscribeToObservable;
|
|
4497
|
+
Object.defineProperty(Observable.prototype, "active", {
|
|
4498
|
+
enumerable: true,
|
|
4499
|
+
get: getObservableActive
|
|
4585
4500
|
});
|
|
4586
4501
|
/**
|
|
4587
4502
|
* Create a new beacon
|
|
@@ -4606,8 +4521,7 @@ function closeBeacon(state, emit) {
|
|
|
4606
4521
|
}
|
|
4607
4522
|
function createBeaconOptions(input) {
|
|
4608
4523
|
const options = isPlainObject(input) ? input : {};
|
|
4609
|
-
|
|
4610
|
-
return options;
|
|
4524
|
+
return { equal: typeof options.equal === "function" ? options.equal : Object.is };
|
|
4611
4525
|
}
|
|
4612
4526
|
function createObserver(first, second, third) {
|
|
4613
4527
|
let observer = { next: noop };
|
|
@@ -4617,9 +4531,10 @@ function createObserver(first, second, third) {
|
|
|
4617
4531
|
complete: getObservableCallback(third)
|
|
4618
4532
|
};
|
|
4619
4533
|
else if (typeof first === "object") {
|
|
4620
|
-
|
|
4621
|
-
observer.
|
|
4622
|
-
observer.
|
|
4534
|
+
const object = first;
|
|
4535
|
+
observer.complete = getObservableCallback(object?.complete);
|
|
4536
|
+
observer.error = getObservableCallback(object?.error);
|
|
4537
|
+
observer.next = getObservableCallback(object?.next);
|
|
4623
4538
|
}
|
|
4624
4539
|
return observer;
|
|
4625
4540
|
}
|
|
@@ -4638,11 +4553,22 @@ function emitBeaconValue(value, finish) {
|
|
|
4638
4553
|
function finishBeacon() {
|
|
4639
4554
|
closeBeacon(this[BEACON_SYMBOL], true);
|
|
4640
4555
|
}
|
|
4641
|
-
function
|
|
4556
|
+
function getBeaconActive() {
|
|
4557
|
+
return this[BEACON_SYMBOL].active;
|
|
4558
|
+
}
|
|
4559
|
+
function getBeaconObservable() {
|
|
4560
|
+
const state = this[BEACON_SYMBOL];
|
|
4642
4561
|
if (!state.active) throw new Error(BEACON_MESSAGE_RETRIEVE);
|
|
4643
4562
|
state.observable ??= new Observable(state);
|
|
4644
4563
|
return state.observable;
|
|
4645
4564
|
}
|
|
4565
|
+
function getBeaconValue() {
|
|
4566
|
+
return this[BEACON_SYMBOL].value;
|
|
4567
|
+
}
|
|
4568
|
+
function getObservableActive() {
|
|
4569
|
+
const state = this[BEACON_SYMBOL];
|
|
4570
|
+
return state.beacon.active && state.active;
|
|
4571
|
+
}
|
|
4646
4572
|
function getObservableCallback(value) {
|
|
4647
4573
|
return typeof value === "function" ? value : noop;
|
|
4648
4574
|
}
|
|
@@ -4656,7 +4582,7 @@ function isBeacon(value) {
|
|
|
4656
4582
|
return isBeaconInstance(BEACON_NAME, value);
|
|
4657
4583
|
}
|
|
4658
4584
|
function isBeaconInstance(name, value) {
|
|
4659
|
-
return typeof value === "object" && value !== null && value[BEACON_PROPERTY] === name;
|
|
4585
|
+
return typeof value === "object" && value !== null && BEACON_PROPERTY in value && value[BEACON_PROPERTY] === name;
|
|
4660
4586
|
}
|
|
4661
4587
|
/**
|
|
4662
4588
|
* Is the value a beacon subscription?
|
|
@@ -4718,23 +4644,19 @@ function Events(herald, state) {
|
|
|
4718
4644
|
}
|
|
4719
4645
|
Events.prototype[HERALD_PROPERTY] = HERALD_NAME_EVENTS;
|
|
4720
4646
|
function Herald(state) {
|
|
4721
|
-
|
|
4647
|
+
this[HERALD_SYMBOL] = {
|
|
4722
4648
|
state,
|
|
4723
4649
|
events: new Events(this, state)
|
|
4724
|
-
}
|
|
4650
|
+
};
|
|
4725
4651
|
}
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
}
|
|
4735
|
-
},
|
|
4736
|
-
observed: { value: eventIsObserved },
|
|
4737
|
-
subscribe: { value: subscribeToHerald }
|
|
4652
|
+
Herald.prototype[HERALD_PROPERTY] = HERALD_NAME_HERALD;
|
|
4653
|
+
Herald.prototype.clear = clearHerald;
|
|
4654
|
+
Herald.prototype.emit = emitForHerald;
|
|
4655
|
+
Herald.prototype.observed = eventIsObserved;
|
|
4656
|
+
Herald.prototype.subscribe = subscribeToHerald;
|
|
4657
|
+
Object.defineProperty(Herald.prototype, "events", {
|
|
4658
|
+
enumerable: true,
|
|
4659
|
+
get: getHeraldEvents
|
|
4738
4660
|
});
|
|
4739
4661
|
function clearHerald() {
|
|
4740
4662
|
this[HERALD_SYMBOL].state.store.clear();
|
|
@@ -4771,6 +4693,9 @@ function emitForHerald(event, ...parameters) {
|
|
|
4771
4693
|
function eventIsObserved(event) {
|
|
4772
4694
|
return (this[HERALD_SYMBOL].state.store.items.keyed?.get(event)?.size ?? 0) > 0;
|
|
4773
4695
|
}
|
|
4696
|
+
function getHeraldEvents() {
|
|
4697
|
+
return this[HERALD_SYMBOL].events;
|
|
4698
|
+
}
|
|
4774
4699
|
/**
|
|
4775
4700
|
* Create a _Herald_ for announcing named events
|
|
4776
4701
|
*
|
|
@@ -4809,7 +4734,7 @@ function isHeraldInstance(name, value) {
|
|
|
4809
4734
|
* @returns `true` if the value is a herald subscription, otherwise `false`
|
|
4810
4735
|
*/
|
|
4811
4736
|
function isHeraldSubscription(value) {
|
|
4812
|
-
return isSubscription(value) && value[HERALD_PROPERTY] === "subscription";
|
|
4737
|
+
return isSubscription(value) && HERALD_PROPERTY in value && value[HERALD_PROPERTY] === "subscription";
|
|
4813
4738
|
}
|
|
4814
4739
|
function subscribeToHerald(key, callback, signal) {
|
|
4815
4740
|
const { state } = this[HERALD_SYMBOL];
|
|
@@ -4969,6 +4894,9 @@ function getAlpha(value, hex) {
|
|
|
4969
4894
|
};
|
|
4970
4895
|
return getAlphaFromValue(Number.parseFloat(value));
|
|
4971
4896
|
}
|
|
4897
|
+
function getColorAlpha() {
|
|
4898
|
+
return this[COLOR_SYMBOL].values.alpha.value;
|
|
4899
|
+
}
|
|
4972
4900
|
function getAlphaHexadecimal(value) {
|
|
4973
4901
|
if (value === COLOR_ALPHA.noneValue) return COLOR_ALPHA.noneHex;
|
|
4974
4902
|
if (value === COLOR_MAX.percent) return COLOR_ALPHA.fullHexLong;
|
|
@@ -4985,6 +4913,9 @@ function getAlphaValue(original) {
|
|
|
4985
4913
|
if (Number.isNaN(original)) return COLOR_MAX.percent;
|
|
4986
4914
|
return clamp(original, COLOR_ALPHA.noneValue, COLOR_MAX.percent);
|
|
4987
4915
|
}
|
|
4916
|
+
function setColorAlpha(value) {
|
|
4917
|
+
if (typeof value === "number" && !Number.isNaN(value)) this[COLOR_SYMBOL].values.alpha = getAlpha(value, false);
|
|
4918
|
+
}
|
|
4988
4919
|
//#endregion
|
|
4989
4920
|
//#region src/color/misc/get.ts
|
|
4990
4921
|
function getClampedValue(value, minimum, maximum, rounding) {
|
|
@@ -5144,11 +5075,12 @@ function isBytey(value) {
|
|
|
5144
5075
|
function isColor(value) {
|
|
5145
5076
|
return typeof value === "object" && value !== null && "$color" in value && value["$color"] === "color";
|
|
5146
5077
|
}
|
|
5147
|
-
function isColorValue(
|
|
5148
|
-
if (typeof
|
|
5149
|
-
const keys = Object.keys(
|
|
5078
|
+
function isColorValue(value, properties) {
|
|
5079
|
+
if (typeof value !== "object" || value === null) return false;
|
|
5080
|
+
const keys = Object.keys(value);
|
|
5150
5081
|
const { length } = keys;
|
|
5151
5082
|
if (length !== properties.length) return false;
|
|
5083
|
+
const obj = value;
|
|
5152
5084
|
for (let index = 0; index < length; index += 1) {
|
|
5153
5085
|
const key = keys[index];
|
|
5154
5086
|
if (!(properties.includes(key) && validators[key](obj[key]))) return false;
|
|
@@ -5276,7 +5208,7 @@ function convertRgbToHex(rgb, alpha) {
|
|
|
5276
5208
|
return `${hex}${a}`;
|
|
5277
5209
|
}
|
|
5278
5210
|
function convertRgbToHsla(value) {
|
|
5279
|
-
const values =
|
|
5211
|
+
const values = getRgbCalculationValues(isRgbLike(value) ? getRgbValues(value) : { ...COLOR_DEFAULTS.rgb });
|
|
5280
5212
|
const { delta, max, min } = values;
|
|
5281
5213
|
const lightness = (min + max) / 2;
|
|
5282
5214
|
let hue = 0;
|
|
@@ -5294,7 +5226,7 @@ function convertRgbToHsla(value) {
|
|
|
5294
5226
|
};
|
|
5295
5227
|
}
|
|
5296
5228
|
function convertRgbToHwba(value) {
|
|
5297
|
-
const values =
|
|
5229
|
+
const values = getRgbCalculationValues(isRgbLike(value) ? getRgbValues(value) : { ...COLOR_DEFAULTS.rgb });
|
|
5298
5230
|
const { delta, max, min } = values;
|
|
5299
5231
|
let hue = 0;
|
|
5300
5232
|
if (delta !== 0) {
|
|
@@ -5320,22 +5252,7 @@ function getColorFromRgb(state, type) {
|
|
|
5320
5252
|
}
|
|
5321
5253
|
return state[type];
|
|
5322
5254
|
}
|
|
5323
|
-
function
|
|
5324
|
-
const { blue, delta, green, max, red } = values;
|
|
5325
|
-
switch (max) {
|
|
5326
|
-
case blue: return (red - green) / delta + 4;
|
|
5327
|
-
case green: return (blue - red) / delta + 2;
|
|
5328
|
-
default: return (green - blue) / delta + (green < blue ? 6 : 0);
|
|
5329
|
-
}
|
|
5330
|
-
}
|
|
5331
|
-
function getRgbValue(value) {
|
|
5332
|
-
return {
|
|
5333
|
-
blue: getHexValue(value.blue),
|
|
5334
|
-
green: getHexValue(value.green),
|
|
5335
|
-
red: getHexValue(value.red)
|
|
5336
|
-
};
|
|
5337
|
-
}
|
|
5338
|
-
function getRgbValues(rgb) {
|
|
5255
|
+
function getRgbCalculationValues(rgb) {
|
|
5339
5256
|
const blue = rgb.blue / COLOR_MAX.hex;
|
|
5340
5257
|
const green = rgb.green / COLOR_MAX.hex;
|
|
5341
5258
|
const red = rgb.red / COLOR_MAX.hex;
|
|
@@ -5350,6 +5267,27 @@ function getRgbValues(rgb) {
|
|
|
5350
5267
|
red
|
|
5351
5268
|
};
|
|
5352
5269
|
}
|
|
5270
|
+
function getRgbColor$1() {
|
|
5271
|
+
return getStateValue(this, COLOR_TYPE.rgb, false);
|
|
5272
|
+
}
|
|
5273
|
+
function getRgbaColor$1() {
|
|
5274
|
+
return getStateValue(this, COLOR_TYPE.rgb, true);
|
|
5275
|
+
}
|
|
5276
|
+
function getRgbHue(values) {
|
|
5277
|
+
const { blue, delta, green, max, red } = values;
|
|
5278
|
+
switch (max) {
|
|
5279
|
+
case blue: return (red - green) / delta + 4;
|
|
5280
|
+
case green: return (blue - red) / delta + 2;
|
|
5281
|
+
default: return (green - blue) / delta + (green < blue ? 6 : 0);
|
|
5282
|
+
}
|
|
5283
|
+
}
|
|
5284
|
+
function getRgbValues(value) {
|
|
5285
|
+
return {
|
|
5286
|
+
blue: getHexValue(value.blue),
|
|
5287
|
+
green: getHexValue(value.green),
|
|
5288
|
+
red: getHexValue(value.red)
|
|
5289
|
+
};
|
|
5290
|
+
}
|
|
5353
5291
|
/**
|
|
5354
5292
|
* Convert an _RGB(A)_ color to a hex color _(with optional alpha channel, i.e., opacity)_
|
|
5355
5293
|
*
|
|
@@ -5360,7 +5298,7 @@ function getRgbValues(rgb) {
|
|
|
5360
5298
|
* @returns Hex color string
|
|
5361
5299
|
*/
|
|
5362
5300
|
function rgbToHex(rgb, alpha) {
|
|
5363
|
-
return convertRgbToHex(isRgbLike(rgb) ?
|
|
5301
|
+
return convertRgbToHex(isRgbLike(rgb) ? getRgbValues(rgb) : { ...COLOR_DEFAULTS.rgb }, alpha ?? false);
|
|
5364
5302
|
}
|
|
5365
5303
|
/**
|
|
5366
5304
|
* Convert an _RGB(A)_ color to an _HSL_ color
|
|
@@ -5424,6 +5362,20 @@ function rgbToHwb(rgb) {
|
|
|
5424
5362
|
function rgbToHwba(rgb) {
|
|
5425
5363
|
return convertRgbToHwba(rgb);
|
|
5426
5364
|
}
|
|
5365
|
+
function setRgbValue(value) {
|
|
5366
|
+
setRgbColorValueInState(this, value, false);
|
|
5367
|
+
}
|
|
5368
|
+
function setRgbColorValueInState(instance, value, alpha) {
|
|
5369
|
+
if (!isRgbLike(value)) return;
|
|
5370
|
+
setStateValue(instance, COLOR_TYPE.rgb, {
|
|
5371
|
+
red: getHexValue(value.red),
|
|
5372
|
+
green: getHexValue(value.green),
|
|
5373
|
+
blue: getHexValue(value.blue)
|
|
5374
|
+
}, alpha ? value.alpha : void 0);
|
|
5375
|
+
}
|
|
5376
|
+
function setRgbaValue(value) {
|
|
5377
|
+
setRgbColorValueInState(this, value, true);
|
|
5378
|
+
}
|
|
5427
5379
|
//#endregion
|
|
5428
5380
|
//#region src/color/space/hex.ts
|
|
5429
5381
|
function convertHexToRgba(value) {
|
|
@@ -5451,6 +5403,12 @@ function getColorFromHex(state, type) {
|
|
|
5451
5403
|
}
|
|
5452
5404
|
return state[type];
|
|
5453
5405
|
}
|
|
5406
|
+
function getHexColor$1() {
|
|
5407
|
+
return getStateValue(this, COLOR_TYPE.hex, false);
|
|
5408
|
+
}
|
|
5409
|
+
function getHexaColor$1() {
|
|
5410
|
+
return getStateValue(this, COLOR_TYPE.hex, true);
|
|
5411
|
+
}
|
|
5454
5412
|
/**
|
|
5455
5413
|
* Get the normalized hex color from a value
|
|
5456
5414
|
*
|
|
@@ -5548,10 +5506,22 @@ function hexToRgb(value) {
|
|
|
5548
5506
|
function hexToRgba(value) {
|
|
5549
5507
|
return convertHexToRgba(value);
|
|
5550
5508
|
}
|
|
5509
|
+
function setHexValue(value) {
|
|
5510
|
+
setHexValueInState(this, value, false);
|
|
5511
|
+
}
|
|
5512
|
+
function setHexValueInState(instance, value, alpha) {
|
|
5513
|
+
const { values } = instance[COLOR_SYMBOL];
|
|
5514
|
+
if (!isHexColor(value) || !alpha && value === values.hex) return;
|
|
5515
|
+
const normalized = getNormalizedHex(value, true);
|
|
5516
|
+
setStateValue(instance, COLOR_TYPE.hex, normalized.slice(0, COLOR_LENGTHS.hexLong), alpha ? normalized.slice(COLOR_LENGTHS.hexLong) : void 0);
|
|
5517
|
+
}
|
|
5518
|
+
function setHexaValue(value) {
|
|
5519
|
+
setHexValueInState(this, value, true);
|
|
5520
|
+
}
|
|
5551
5521
|
//#endregion
|
|
5552
5522
|
//#region src/color/space/hsl.ts
|
|
5553
5523
|
function convertHslToHwba(input) {
|
|
5554
|
-
let { hue, lightness, saturation } = isHslLike(input) ?
|
|
5524
|
+
let { hue, lightness, saturation } = isHslLike(input) ? getHslValues(input) : { ...COLOR_DEFAULTS.hsl };
|
|
5555
5525
|
lightness /= COLOR_MAX.percent;
|
|
5556
5526
|
saturation /= COLOR_MAX.percent;
|
|
5557
5527
|
const value = lightness + saturation * Math.min(lightness, 1 - lightness);
|
|
@@ -5566,7 +5536,7 @@ function convertHslToHwba(input) {
|
|
|
5566
5536
|
};
|
|
5567
5537
|
}
|
|
5568
5538
|
function convertHslToRgba(input) {
|
|
5569
|
-
const hsl = isHslLike(input) ?
|
|
5539
|
+
const hsl = isHslLike(input) ? getHslValues(input) : { ...COLOR_DEFAULTS.hsl };
|
|
5570
5540
|
const hue = hsl.hue % COLOR_MAX.degree;
|
|
5571
5541
|
const saturation = hsl.saturation / COLOR_MAX.percent;
|
|
5572
5542
|
const lightness = hsl.lightness / COLOR_MAX.percent;
|
|
@@ -5593,7 +5563,13 @@ function getHexyValue(hue, lightness, saturation, value) {
|
|
|
5593
5563
|
const part = (value + hue / 30) % 12;
|
|
5594
5564
|
return (lightness - saturation * Math.min(lightness, 1 - lightness) * Math.max(-1, Math.min(part - 3, 9 - part, 1))) * COLOR_MAX.hex;
|
|
5595
5565
|
}
|
|
5596
|
-
function getHslValue(
|
|
5566
|
+
function getHslValue() {
|
|
5567
|
+
return getStateValue(this, COLOR_TYPE.hsl, false);
|
|
5568
|
+
}
|
|
5569
|
+
function getHslaValue() {
|
|
5570
|
+
return getStateValue(this, COLOR_TYPE.hsl, true);
|
|
5571
|
+
}
|
|
5572
|
+
function getHslValues(value) {
|
|
5597
5573
|
return {
|
|
5598
5574
|
hue: getDegrees(value.hue),
|
|
5599
5575
|
saturation: getPercentage(value.saturation),
|
|
@@ -5670,10 +5646,24 @@ function hslToRgb(hsl) {
|
|
|
5670
5646
|
function hslToRgba(hsl) {
|
|
5671
5647
|
return convertHslToRgba(hsl);
|
|
5672
5648
|
}
|
|
5649
|
+
function setHslValue(value) {
|
|
5650
|
+
setHSLValueInState(this, value, false);
|
|
5651
|
+
}
|
|
5652
|
+
function setHSLValueInState(instance, value, alpha) {
|
|
5653
|
+
if (!isHslLike(value)) return;
|
|
5654
|
+
setStateValue(instance, COLOR_TYPE.hsl, {
|
|
5655
|
+
hue: getDegrees(value.hue),
|
|
5656
|
+
saturation: getPercentage(value.saturation),
|
|
5657
|
+
lightness: getPercentage(value.lightness)
|
|
5658
|
+
}, alpha ? value.alpha : void 0);
|
|
5659
|
+
}
|
|
5660
|
+
function setHslaValue(value) {
|
|
5661
|
+
setHSLValueInState(this, value, true);
|
|
5662
|
+
}
|
|
5673
5663
|
//#endregion
|
|
5674
5664
|
//#region src/color/space/hwb.ts
|
|
5675
5665
|
function convertHwbToHsl(input) {
|
|
5676
|
-
let { blackness, hue, whiteness } = isHwbLike(input) ?
|
|
5666
|
+
let { blackness, hue, whiteness } = isHwbLike(input) ? getHwbValues(input) : COLOR_DEFAULTS.hwb;
|
|
5677
5667
|
blackness /= COLOR_MAX.percent;
|
|
5678
5668
|
whiteness /= COLOR_MAX.percent;
|
|
5679
5669
|
if (blackness + whiteness > 1) {
|
|
@@ -5706,7 +5696,13 @@ function getHwbSaturation(blackness, whiteness, lightness) {
|
|
|
5706
5696
|
if (hue <= 0) return 0;
|
|
5707
5697
|
return hue / Math.min(2 * lightness, 2 - 2 * lightness);
|
|
5708
5698
|
}
|
|
5709
|
-
function getHwbValue(
|
|
5699
|
+
function getHwbValue() {
|
|
5700
|
+
return getStateValue(this, COLOR_TYPE.hwb, false);
|
|
5701
|
+
}
|
|
5702
|
+
function getHwbaValue() {
|
|
5703
|
+
return getStateValue(this, COLOR_TYPE.hwb, true);
|
|
5704
|
+
}
|
|
5705
|
+
function getHwbValues(value) {
|
|
5710
5706
|
return {
|
|
5711
5707
|
hue: getDegrees(value.hue),
|
|
5712
5708
|
whiteness: getPercentage(value.whiteness),
|
|
@@ -5774,6 +5770,20 @@ function hwbToRgb(hwb) {
|
|
|
5774
5770
|
function hwbToRgba(hwb) {
|
|
5775
5771
|
return hslToRgba(hwbToHsla(hwb));
|
|
5776
5772
|
}
|
|
5773
|
+
function setHwbValue(value) {
|
|
5774
|
+
setHwbColorValueInState(this, value, false);
|
|
5775
|
+
}
|
|
5776
|
+
function setHwbColorValueInState(instance, value, alpha) {
|
|
5777
|
+
if (!isHwbLike(value)) return;
|
|
5778
|
+
setStateValue(instance, COLOR_TYPE.hwb, {
|
|
5779
|
+
hue: getDegrees(value.hue),
|
|
5780
|
+
whiteness: getPercentage(value.whiteness),
|
|
5781
|
+
blackness: getPercentage(value.blackness)
|
|
5782
|
+
}, alpha ? value.alpha : void 0);
|
|
5783
|
+
}
|
|
5784
|
+
function setHwbaValue(value) {
|
|
5785
|
+
setHwbColorValueInState(this, value, true);
|
|
5786
|
+
}
|
|
5777
5787
|
//#endregion
|
|
5778
5788
|
//#region src/color/misc/state.ts
|
|
5779
5789
|
function getColorFromState(state, type) {
|
|
@@ -5797,13 +5807,13 @@ function getColorState(value) {
|
|
|
5797
5807
|
origin: void 0
|
|
5798
5808
|
};
|
|
5799
5809
|
if (COLOR_KEYS.hsl.every((key) => key in value)) {
|
|
5800
|
-
state.hsl =
|
|
5810
|
+
state.hsl = getHslValues(value);
|
|
5801
5811
|
state.origin = COLOR_TYPE.hsl;
|
|
5802
5812
|
} else if (COLOR_KEYS.hwb.every((key) => key in value)) {
|
|
5803
|
-
state.hwb =
|
|
5813
|
+
state.hwb = getHwbValues(value);
|
|
5804
5814
|
state.origin = COLOR_TYPE.hwb;
|
|
5805
5815
|
} else if (COLOR_KEYS.rgb.every((key) => key in value)) {
|
|
5806
|
-
state.rgb =
|
|
5816
|
+
state.rgb = getRgbValues(value);
|
|
5807
5817
|
state.origin = COLOR_TYPE.rgb;
|
|
5808
5818
|
}
|
|
5809
5819
|
if (state.origin != null) return state;
|
|
@@ -5828,7 +5838,16 @@ function getDefaultColorState() {
|
|
|
5828
5838
|
origin: COLOR_TYPE.hex
|
|
5829
5839
|
};
|
|
5830
5840
|
}
|
|
5831
|
-
function
|
|
5841
|
+
function getStateValue(instance, type, alpha) {
|
|
5842
|
+
const { values } = instance[COLOR_SYMBOL];
|
|
5843
|
+
const value = getColorFromState(values, type);
|
|
5844
|
+
if (typeof value === "string") return alpha ? `${value}${values.alpha.hex}` : value;
|
|
5845
|
+
return alpha ? {
|
|
5846
|
+
...value,
|
|
5847
|
+
alpha: values.alpha.value
|
|
5848
|
+
} : { ...value };
|
|
5849
|
+
}
|
|
5850
|
+
function setStateValue(instance, type, value, alpha) {
|
|
5832
5851
|
const { changes, values } = instance[COLOR_SYMBOL];
|
|
5833
5852
|
values.hex = void 0;
|
|
5834
5853
|
values.hsl = void 0;
|
|
@@ -5840,36 +5859,6 @@ function setColorValue(instance, type, value, alpha) {
|
|
|
5840
5859
|
for (const type of COLOR_TYPE.all) if (changes.observed(type)) changes.emit(type, instance[type]);
|
|
5841
5860
|
changes.emit(COLOR_TYPE.wildcard, instance);
|
|
5842
5861
|
}
|
|
5843
|
-
function setHexColor(instance, value, alpha) {
|
|
5844
|
-
const { values } = instance[COLOR_SYMBOL];
|
|
5845
|
-
if (!isHexColor(value) || !alpha && value === values.hex) return;
|
|
5846
|
-
const normalized = getNormalizedHex(value, true);
|
|
5847
|
-
setColorValue(instance, COLOR_TYPE.hex, normalized.slice(0, COLOR_LENGTHS.hexLong), alpha ? normalized.slice(COLOR_LENGTHS.hexLong) : void 0);
|
|
5848
|
-
}
|
|
5849
|
-
function setHSLColor(instance, value, alpha) {
|
|
5850
|
-
if (!isHslLike(value)) return;
|
|
5851
|
-
setColorValue(instance, COLOR_TYPE.hsl, {
|
|
5852
|
-
hue: getDegrees(value.hue),
|
|
5853
|
-
saturation: getPercentage(value.saturation),
|
|
5854
|
-
lightness: getPercentage(value.lightness)
|
|
5855
|
-
}, alpha ? value.alpha : void 0);
|
|
5856
|
-
}
|
|
5857
|
-
function setHWBColor(instance, value, alpha) {
|
|
5858
|
-
if (!isHwbLike(value)) return;
|
|
5859
|
-
setColorValue(instance, COLOR_TYPE.hwb, {
|
|
5860
|
-
hue: getDegrees(value.hue),
|
|
5861
|
-
whiteness: getPercentage(value.whiteness),
|
|
5862
|
-
blackness: getPercentage(value.blackness)
|
|
5863
|
-
}, alpha ? value.alpha : void 0);
|
|
5864
|
-
}
|
|
5865
|
-
function setRGBColor(instance, value, alpha) {
|
|
5866
|
-
if (!isRgbLike(value)) return;
|
|
5867
|
-
setColorValue(instance, COLOR_TYPE.rgb, {
|
|
5868
|
-
red: getHexValue(value.red),
|
|
5869
|
-
green: getHexValue(value.green),
|
|
5870
|
-
blue: getHexValue(value.blue)
|
|
5871
|
-
}, alpha ? value.alpha : void 0);
|
|
5872
|
-
}
|
|
5873
5862
|
const getters = {
|
|
5874
5863
|
hex: getColorFromHex,
|
|
5875
5864
|
hsl: getColorFromHsl,
|
|
@@ -5902,129 +5891,86 @@ function getSuffix(state, alpha) {
|
|
|
5902
5891
|
//#endregion
|
|
5903
5892
|
//#region src/color/instance.ts
|
|
5904
5893
|
function Color(value) {
|
|
5905
|
-
|
|
5894
|
+
this[COLOR_SYMBOL] = {
|
|
5906
5895
|
changes: herald({
|
|
5907
5896
|
names: [COLOR_TYPE.wildcard, ...COLOR_TYPE.all],
|
|
5908
5897
|
property: colorSubscription,
|
|
5909
5898
|
onCreate: (event, callback) => onCreateSubscription(this, event, callback)
|
|
5910
5899
|
}),
|
|
5911
5900
|
values: getColorState(value)
|
|
5912
|
-
}
|
|
5901
|
+
};
|
|
5913
5902
|
}
|
|
5903
|
+
Color.prototype[COLOR_PROPERTY] = COLOR_NAME;
|
|
5904
|
+
Color.prototype.subscribe = subscribeToColor;
|
|
5905
|
+
Color.prototype.toHexString = formatHexColor;
|
|
5906
|
+
Color.prototype.toHslString = formatHslColor;
|
|
5907
|
+
Color.prototype.toHwbString = formatHwbColor;
|
|
5908
|
+
Color.prototype.toRgbString = formatRgbColor;
|
|
5909
|
+
Color.prototype.toString = formatHexColor;
|
|
5910
|
+
Color.prototype.unsubscribe = unsubscribeFromColor;
|
|
5914
5911
|
Object.defineProperties(Color.prototype, {
|
|
5915
|
-
[COLOR_PROPERTY]: { value: COLOR_NAME },
|
|
5916
5912
|
alpha: {
|
|
5917
5913
|
enumerable: true,
|
|
5918
|
-
get
|
|
5919
|
-
|
|
5920
|
-
},
|
|
5921
|
-
set(value) {
|
|
5922
|
-
setAlphaValue(this[COLOR_SYMBOL].values, value);
|
|
5923
|
-
}
|
|
5914
|
+
get: getColorAlpha,
|
|
5915
|
+
set: setColorAlpha
|
|
5924
5916
|
},
|
|
5925
5917
|
changes: {
|
|
5926
5918
|
enumerable: true,
|
|
5927
|
-
get
|
|
5928
|
-
return this[COLOR_SYMBOL].changes.events;
|
|
5929
|
-
}
|
|
5919
|
+
get: getColorChanges
|
|
5930
5920
|
},
|
|
5931
5921
|
hex: {
|
|
5932
5922
|
enumerable: true,
|
|
5933
|
-
get
|
|
5934
|
-
|
|
5935
|
-
},
|
|
5936
|
-
set(value) {
|
|
5937
|
-
setHexColor(this, value, false);
|
|
5938
|
-
}
|
|
5923
|
+
get: getHexColor$1,
|
|
5924
|
+
set: setHexValue
|
|
5939
5925
|
},
|
|
5940
5926
|
hexa: {
|
|
5941
5927
|
enumerable: true,
|
|
5942
|
-
get
|
|
5943
|
-
|
|
5944
|
-
},
|
|
5945
|
-
set(value) {
|
|
5946
|
-
setHexColor(this, value, true);
|
|
5947
|
-
}
|
|
5928
|
+
get: getHexaColor$1,
|
|
5929
|
+
set: setHexaValue
|
|
5948
5930
|
},
|
|
5949
5931
|
hsl: {
|
|
5950
5932
|
enumerable: true,
|
|
5951
|
-
get
|
|
5952
|
-
|
|
5953
|
-
},
|
|
5954
|
-
set(value) {
|
|
5955
|
-
setHSLColor(this, value, false);
|
|
5956
|
-
}
|
|
5933
|
+
get: getHslValue,
|
|
5934
|
+
set: setHslValue
|
|
5957
5935
|
},
|
|
5958
5936
|
hsla: {
|
|
5959
5937
|
enumerable: true,
|
|
5960
|
-
get
|
|
5961
|
-
|
|
5962
|
-
},
|
|
5963
|
-
set(value) {
|
|
5964
|
-
setHSLColor(this, value, true);
|
|
5965
|
-
}
|
|
5938
|
+
get: getHslaValue,
|
|
5939
|
+
set: setHslaValue
|
|
5966
5940
|
},
|
|
5967
5941
|
hwb: {
|
|
5968
5942
|
enumerable: true,
|
|
5969
|
-
get
|
|
5970
|
-
|
|
5971
|
-
},
|
|
5972
|
-
set(value) {
|
|
5973
|
-
setHWBColor(this, value, false);
|
|
5974
|
-
}
|
|
5943
|
+
get: getHwbValue,
|
|
5944
|
+
set: setHwbValue
|
|
5975
5945
|
},
|
|
5976
5946
|
hwba: {
|
|
5977
5947
|
enumerable: true,
|
|
5978
|
-
get
|
|
5979
|
-
|
|
5980
|
-
},
|
|
5981
|
-
set(value) {
|
|
5982
|
-
setHWBColor(this, value, true);
|
|
5983
|
-
}
|
|
5948
|
+
get: getHwbaValue,
|
|
5949
|
+
set: setHwbaValue
|
|
5984
5950
|
},
|
|
5985
5951
|
origin: {
|
|
5986
5952
|
enumerable: true,
|
|
5987
|
-
get
|
|
5988
|
-
return this[COLOR_SYMBOL].values.origin;
|
|
5989
|
-
}
|
|
5953
|
+
get: getOrigin
|
|
5990
5954
|
},
|
|
5991
5955
|
rgb: {
|
|
5992
5956
|
enumerable: true,
|
|
5993
|
-
get
|
|
5994
|
-
|
|
5995
|
-
},
|
|
5996
|
-
set(value) {
|
|
5997
|
-
setRGBColor(this, value, false);
|
|
5998
|
-
}
|
|
5957
|
+
get: getRgbColor$1,
|
|
5958
|
+
set: setRgbValue
|
|
5999
5959
|
},
|
|
6000
5960
|
rgba: {
|
|
6001
5961
|
enumerable: true,
|
|
6002
|
-
get
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
set(value) {
|
|
6006
|
-
setRGBColor(this, value, true);
|
|
6007
|
-
}
|
|
6008
|
-
},
|
|
6009
|
-
subscribe: { value: subscribeToColor },
|
|
6010
|
-
toHexString: { value: formatHexColor },
|
|
6011
|
-
toHslString: { value: formatHslColor },
|
|
6012
|
-
toHwbString: { value: formatHwbColor },
|
|
6013
|
-
toRgbString: { value: formatRgbColor },
|
|
6014
|
-
toString: { value: formatHexColor },
|
|
6015
|
-
unsubscribe: { value: unsubscribeFromColor }
|
|
5962
|
+
get: getRgbaColor$1,
|
|
5963
|
+
set: setRgbaValue
|
|
5964
|
+
}
|
|
6016
5965
|
});
|
|
6017
5966
|
function color(value) {
|
|
6018
5967
|
return new Color(value);
|
|
6019
5968
|
}
|
|
6020
|
-
function
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
return
|
|
6025
|
-
...value,
|
|
6026
|
-
alpha: values.alpha.value
|
|
6027
|
-
} : { ...value };
|
|
5969
|
+
function getColorChanges() {
|
|
5970
|
+
return this[COLOR_SYMBOL].changes.events;
|
|
5971
|
+
}
|
|
5972
|
+
function getOrigin() {
|
|
5973
|
+
return this[COLOR_SYMBOL].values.origin;
|
|
6028
5974
|
}
|
|
6029
5975
|
function onCreateSubscription(instance, event, callback) {
|
|
6030
5976
|
let value;
|
|
@@ -6032,9 +5978,6 @@ function onCreateSubscription(instance, event, callback) {
|
|
|
6032
5978
|
else value = instance[event];
|
|
6033
5979
|
callback(value);
|
|
6034
5980
|
}
|
|
6035
|
-
function setAlphaValue(state, value) {
|
|
6036
|
-
if (typeof value === "number" && !Number.isNaN(value)) state.alpha = getAlpha(value, false);
|
|
6037
|
-
}
|
|
6038
5981
|
function subscribeToColor(callback, signal) {
|
|
6039
5982
|
const { changes } = this[COLOR_SYMBOL];
|
|
6040
5983
|
return changes.subscribe(COLOR_TYPE.wildcard, callback, signal);
|
|
@@ -6180,36 +6123,32 @@ const EXPRESSION_WHITESPACE = /^\s*$/;
|
|
|
6180
6123
|
const LOGGER_NAME = "Logger";
|
|
6181
6124
|
const LOGGER_NAME_TIMED = "TimedLogger";
|
|
6182
6125
|
const LOGGER_PROPERTY = "$logger";
|
|
6183
|
-
function Lumberjack() {
|
|
6184
|
-
for (const method of methods) {
|
|
6185
|
-
const bound = console[method].bind(console);
|
|
6186
|
-
Object.defineProperty(this, method, {
|
|
6187
|
-
enumerable: true,
|
|
6188
|
-
get() {
|
|
6189
|
-
return enabled ? bound : noop;
|
|
6190
|
-
}
|
|
6191
|
-
});
|
|
6192
|
-
}
|
|
6193
|
-
}
|
|
6126
|
+
function Lumberjack() {}
|
|
6194
6127
|
Lumberjack.prototype[LOGGER_PROPERTY] = LOGGER_NAME;
|
|
6128
|
+
Lumberjack.prototype.time = getTimeLogger;
|
|
6195
6129
|
Object.defineProperties(Lumberjack.prototype, {
|
|
6130
|
+
debug: { get: getLoggerCallback.bind("debug") },
|
|
6131
|
+
dir: { get: getLoggerCallback.bind("dir") },
|
|
6132
|
+
error: { get: getLoggerCallback.bind("error") },
|
|
6196
6133
|
enabled: {
|
|
6197
6134
|
enumerable: true,
|
|
6198
|
-
get:
|
|
6199
|
-
set:
|
|
6200
|
-
enabled = typeof value === "boolean" ? value : enabled;
|
|
6201
|
-
}
|
|
6135
|
+
get: getLoggerEnabled,
|
|
6136
|
+
set: setLoggerEnabled
|
|
6202
6137
|
},
|
|
6203
|
-
|
|
6138
|
+
info: { get: getLoggerCallback.bind("info") },
|
|
6139
|
+
log: { get: getLoggerCallback.bind("log") },
|
|
6140
|
+
table: { get: getLoggerCallback.bind("table") },
|
|
6141
|
+
trace: { get: getLoggerCallback.bind("trace") },
|
|
6142
|
+
warn: { get: getLoggerCallback.bind("warn") }
|
|
6204
6143
|
});
|
|
6205
6144
|
function TimeLogger(label) {
|
|
6206
|
-
|
|
6145
|
+
this[LOGGER_SYMBOL] = {
|
|
6207
6146
|
label,
|
|
6208
6147
|
started: enabled,
|
|
6209
6148
|
stopped: false
|
|
6210
|
-
}
|
|
6149
|
+
};
|
|
6211
6150
|
this[LOGGER_SYMBOL].isActive = () => {
|
|
6212
|
-
return this[LOGGER_SYMBOL].started && !this[LOGGER_SYMBOL].stopped
|
|
6151
|
+
return enabled && this[LOGGER_SYMBOL].started && !this[LOGGER_SYMBOL].stopped;
|
|
6213
6152
|
};
|
|
6214
6153
|
if (this[LOGGER_SYMBOL].started) console.time(label);
|
|
6215
6154
|
}
|
|
@@ -6217,43 +6156,48 @@ TimeLogger.prototype[LOGGER_PROPERTY] = LOGGER_NAME_TIMED;
|
|
|
6217
6156
|
Object.defineProperties(TimeLogger.prototype, {
|
|
6218
6157
|
active: {
|
|
6219
6158
|
enumerable: true,
|
|
6220
|
-
get
|
|
6221
|
-
return this[LOGGER_SYMBOL].isActive();
|
|
6222
|
-
}
|
|
6159
|
+
get: getTimeLoggerActive
|
|
6223
6160
|
},
|
|
6224
|
-
log: { get
|
|
6225
|
-
|
|
6226
|
-
return state.isActive() ? console.timeLog.bind(console, state.label) : noop;
|
|
6227
|
-
} },
|
|
6228
|
-
stop: { get() {
|
|
6229
|
-
const state = this[LOGGER_SYMBOL];
|
|
6230
|
-
if (state.isActive()) {
|
|
6231
|
-
state.stopped = true;
|
|
6232
|
-
return console.timeEnd.bind(console, state.label);
|
|
6233
|
-
}
|
|
6234
|
-
return noop;
|
|
6235
|
-
} }
|
|
6161
|
+
log: { get: getTimerLoggerLog },
|
|
6162
|
+
stop: { get: getTimeLoggerStop }
|
|
6236
6163
|
});
|
|
6164
|
+
function getLoggerCallback() {
|
|
6165
|
+
return enabled ? console[this].bind(console) : noop;
|
|
6166
|
+
}
|
|
6167
|
+
function getLoggerEnabled() {
|
|
6168
|
+
return enabled;
|
|
6169
|
+
}
|
|
6170
|
+
function getTimeLogger(label) {
|
|
6171
|
+
return new TimeLogger(getString(label));
|
|
6172
|
+
}
|
|
6173
|
+
function getTimeLoggerActive() {
|
|
6174
|
+
return this[LOGGER_SYMBOL].isActive();
|
|
6175
|
+
}
|
|
6176
|
+
function getTimerLoggerLog() {
|
|
6177
|
+
const state = this[LOGGER_SYMBOL];
|
|
6178
|
+
return state.isActive() ? console.timeLog.bind(console, state.label) : noop;
|
|
6179
|
+
}
|
|
6180
|
+
function getTimeLoggerStop() {
|
|
6181
|
+
const state = this[LOGGER_SYMBOL];
|
|
6182
|
+
if (state.isActive()) {
|
|
6183
|
+
state.stopped = true;
|
|
6184
|
+
return console.timeEnd.bind(console, state.label);
|
|
6185
|
+
}
|
|
6186
|
+
return noop;
|
|
6187
|
+
}
|
|
6237
6188
|
function isLogger(value) {
|
|
6238
6189
|
return isLoggerInstance(LOGGER_NAME, value);
|
|
6239
6190
|
}
|
|
6240
6191
|
function isLoggerInstance(name, value) {
|
|
6241
|
-
return typeof value === "object" && value !== null && value[LOGGER_PROPERTY] === name;
|
|
6192
|
+
return typeof value === "object" && value !== null && LOGGER_PROPERTY in value && value[LOGGER_PROPERTY] === name;
|
|
6242
6193
|
}
|
|
6243
6194
|
function isTimeLogger(value) {
|
|
6244
6195
|
return isLoggerInstance(LOGGER_NAME_TIMED, value);
|
|
6245
6196
|
}
|
|
6197
|
+
function setLoggerEnabled(value) {
|
|
6198
|
+
enabled = typeof value === "boolean" ? value : enabled;
|
|
6199
|
+
}
|
|
6246
6200
|
const LOGGER_SYMBOL = Symbol(LOGGER_PROPERTY);
|
|
6247
|
-
const methods = [
|
|
6248
|
-
"debug",
|
|
6249
|
-
"dir",
|
|
6250
|
-
"error",
|
|
6251
|
-
"info",
|
|
6252
|
-
"log",
|
|
6253
|
-
"table",
|
|
6254
|
-
"trace",
|
|
6255
|
-
"warn"
|
|
6256
|
-
];
|
|
6257
6201
|
/**
|
|
6258
6202
|
* A logger that can be used to log messages to the console
|
|
6259
6203
|
*
|
|
@@ -6418,83 +6362,63 @@ var QueueError = class extends Error {
|
|
|
6418
6362
|
}
|
|
6419
6363
|
};
|
|
6420
6364
|
function KeyedQueue(callback, options) {
|
|
6421
|
-
|
|
6365
|
+
this[QUEUE_SYMBOL] = {
|
|
6422
6366
|
callback,
|
|
6423
6367
|
options: createQueueOptions(options),
|
|
6424
6368
|
queues: /* @__PURE__ */ new Map()
|
|
6425
|
-
}
|
|
6369
|
+
};
|
|
6426
6370
|
}
|
|
6371
|
+
KeyedQueue.prototype[QUEUE_PROPERTY] = QUEUE_NAME_KEYED;
|
|
6372
|
+
KeyedQueue.prototype.add = addKeyedQueue;
|
|
6373
|
+
KeyedQueue.prototype.clear = clearQueues;
|
|
6374
|
+
KeyedQueue.prototype.get = getQueue;
|
|
6375
|
+
KeyedQueue.prototype.pause = pauseQueues;
|
|
6376
|
+
KeyedQueue.prototype.remove = removeQueue;
|
|
6377
|
+
KeyedQueue.prototype.resume = resumeQueues;
|
|
6427
6378
|
Object.defineProperties(KeyedQueue.prototype, {
|
|
6428
|
-
[QUEUE_PROPERTY]: { value: QUEUE_NAME_KEYED },
|
|
6429
6379
|
active: {
|
|
6430
6380
|
enumerable: true,
|
|
6431
|
-
get
|
|
6432
|
-
return getStatus(this[QUEUE_SYMBOL], QUEUE_STATUS_ACTIVE);
|
|
6433
|
-
}
|
|
6381
|
+
get: getActiveQueues
|
|
6434
6382
|
},
|
|
6435
|
-
add: { value: addKeyedQueue },
|
|
6436
6383
|
autostart: {
|
|
6437
6384
|
enumerable: true,
|
|
6438
|
-
get
|
|
6439
|
-
return this[QUEUE_SYMBOL].options.autostart;
|
|
6440
|
-
}
|
|
6385
|
+
get: getQueueAutostart
|
|
6441
6386
|
},
|
|
6442
|
-
clear: { value: clearQueues },
|
|
6443
6387
|
concurrency: {
|
|
6444
6388
|
enumerable: true,
|
|
6445
|
-
get
|
|
6446
|
-
return this[QUEUE_SYMBOL].options.concurrency;
|
|
6447
|
-
}
|
|
6389
|
+
get: getQueueConcurrency
|
|
6448
6390
|
},
|
|
6449
6391
|
empty: {
|
|
6450
6392
|
enumerable: true,
|
|
6451
|
-
get
|
|
6452
|
-
return getStatus(this[QUEUE_SYMBOL], QUEUE_STATUS_EMPTY);
|
|
6453
|
-
}
|
|
6393
|
+
get: getEmptyQueues
|
|
6454
6394
|
},
|
|
6455
6395
|
full: {
|
|
6456
6396
|
enumerable: true,
|
|
6457
|
-
get
|
|
6458
|
-
return getStatus(this[QUEUE_SYMBOL], QUEUE_STATUS_FULL);
|
|
6459
|
-
}
|
|
6397
|
+
get: getFullQueues
|
|
6460
6398
|
},
|
|
6461
|
-
get: { value: getQueue },
|
|
6462
6399
|
items: {
|
|
6463
6400
|
enumerable: true,
|
|
6464
|
-
get
|
|
6465
|
-
return getQueueItems(this[QUEUE_SYMBOL]);
|
|
6466
|
-
}
|
|
6401
|
+
get: getKeyedQueueItems
|
|
6467
6402
|
},
|
|
6468
6403
|
keys: {
|
|
6469
6404
|
enumerable: true,
|
|
6470
|
-
get
|
|
6471
|
-
return [...this[QUEUE_SYMBOL].queues.keys()];
|
|
6472
|
-
}
|
|
6405
|
+
get: getQueueKeys
|
|
6473
6406
|
},
|
|
6474
6407
|
maximum: {
|
|
6475
6408
|
enumerable: true,
|
|
6476
|
-
get
|
|
6477
|
-
return this[QUEUE_SYMBOL].options.maximum;
|
|
6478
|
-
}
|
|
6409
|
+
get: getQueueMaximum
|
|
6479
6410
|
},
|
|
6480
|
-
pause: { value: pauseQueues },
|
|
6481
6411
|
paused: {
|
|
6482
6412
|
enumerable: true,
|
|
6483
|
-
get
|
|
6484
|
-
return getStatus(this[QUEUE_SYMBOL], QUEUE_STATUS_PAUSED);
|
|
6485
|
-
}
|
|
6413
|
+
get: getPausedQueues
|
|
6486
6414
|
},
|
|
6487
6415
|
queues: {
|
|
6488
6416
|
enumerable: true,
|
|
6489
|
-
get
|
|
6490
|
-
|
|
6491
|
-
}
|
|
6492
|
-
},
|
|
6493
|
-
remove: { value: removeQueue },
|
|
6494
|
-
resume: { value: resumeQueues }
|
|
6417
|
+
get: getKeyedQueueSize
|
|
6418
|
+
}
|
|
6495
6419
|
});
|
|
6496
6420
|
function Queue(callback, options, key) {
|
|
6497
|
-
|
|
6421
|
+
this[QUEUE_SYMBOL] = {
|
|
6498
6422
|
callback,
|
|
6499
6423
|
key,
|
|
6500
6424
|
options,
|
|
@@ -6503,63 +6427,46 @@ function Queue(callback, options, key) {
|
|
|
6503
6427
|
items: [],
|
|
6504
6428
|
paused: !options.autostart,
|
|
6505
6429
|
runners: 0
|
|
6506
|
-
}
|
|
6430
|
+
};
|
|
6507
6431
|
}
|
|
6432
|
+
Queue.prototype[QUEUE_PROPERTY] = QUEUE_NAME_QUEUE;
|
|
6433
|
+
Queue.prototype.add = addToQueue;
|
|
6434
|
+
Queue.prototype.clear = clearQueue;
|
|
6435
|
+
Queue.prototype.pause = pauseQueue;
|
|
6436
|
+
Queue.prototype.remove = removeQueued;
|
|
6437
|
+
Queue.prototype.resume = resumeQueue;
|
|
6508
6438
|
Object.defineProperties(Queue.prototype, {
|
|
6509
|
-
[QUEUE_PROPERTY]: { value: QUEUE_NAME_QUEUE },
|
|
6510
6439
|
active: {
|
|
6511
6440
|
enumerable: true,
|
|
6512
|
-
get
|
|
6513
|
-
return this[QUEUE_SYMBOL].runners > 0;
|
|
6514
|
-
}
|
|
6441
|
+
get: getQueueActive
|
|
6515
6442
|
},
|
|
6516
|
-
add: { value: addToQueue },
|
|
6517
6443
|
autostart: {
|
|
6518
6444
|
enumerable: true,
|
|
6519
|
-
get
|
|
6520
|
-
return this[QUEUE_SYMBOL].options.autostart;
|
|
6521
|
-
}
|
|
6445
|
+
get: getQueueAutostart
|
|
6522
6446
|
},
|
|
6523
|
-
clear: { value: clearQueue },
|
|
6524
6447
|
concurrency: {
|
|
6525
6448
|
enumerable: true,
|
|
6526
|
-
get
|
|
6527
|
-
return this[QUEUE_SYMBOL].options.concurrency;
|
|
6528
|
-
}
|
|
6449
|
+
get: getQueueConcurrency
|
|
6529
6450
|
},
|
|
6530
6451
|
empty: {
|
|
6531
6452
|
enumerable: true,
|
|
6532
|
-
get
|
|
6533
|
-
return this[QUEUE_SYMBOL].items.length === 0;
|
|
6534
|
-
}
|
|
6453
|
+
get: getQueueEmpty
|
|
6535
6454
|
},
|
|
6536
6455
|
full: {
|
|
6537
6456
|
enumerable: true,
|
|
6538
|
-
get
|
|
6539
|
-
const state = this[QUEUE_SYMBOL];
|
|
6540
|
-
return state.options.maximum > 0 && state.items.length >= state.options.maximum;
|
|
6541
|
-
}
|
|
6457
|
+
get: getQueueFull
|
|
6542
6458
|
},
|
|
6543
6459
|
maximum: {
|
|
6544
6460
|
enumerable: true,
|
|
6545
|
-
get
|
|
6546
|
-
return this[QUEUE_SYMBOL].options.maximum;
|
|
6547
|
-
}
|
|
6461
|
+
get: getQueueMaximum
|
|
6548
6462
|
},
|
|
6549
|
-
pause: { value: pauseQueue },
|
|
6550
6463
|
paused: {
|
|
6551
6464
|
enumerable: true,
|
|
6552
|
-
get
|
|
6553
|
-
return this[QUEUE_SYMBOL].paused;
|
|
6554
|
-
}
|
|
6465
|
+
get: getQueuePaused
|
|
6555
6466
|
},
|
|
6556
|
-
remove: { value: removeQueued },
|
|
6557
|
-
resume: { value: resumeQueue },
|
|
6558
6467
|
size: {
|
|
6559
6468
|
enumerable: true,
|
|
6560
|
-
get
|
|
6561
|
-
return this[QUEUE_SYMBOL].items.length;
|
|
6562
|
-
}
|
|
6469
|
+
get: getQueueSize
|
|
6563
6470
|
}
|
|
6564
6471
|
});
|
|
6565
6472
|
function addKeyedQueue(key, parameters, signal) {
|
|
@@ -6617,6 +6524,28 @@ function createQueueOptions(input) {
|
|
|
6617
6524
|
maximum: getNumberOrDefault(options.maximum, 0)
|
|
6618
6525
|
};
|
|
6619
6526
|
}
|
|
6527
|
+
function getActiveQueues() {
|
|
6528
|
+
return getStatus(this[QUEUE_SYMBOL], QUEUE_STATUS_ACTIVE);
|
|
6529
|
+
}
|
|
6530
|
+
function getEmptyQueues() {
|
|
6531
|
+
return getStatus(this[QUEUE_SYMBOL], QUEUE_STATUS_EMPTY);
|
|
6532
|
+
}
|
|
6533
|
+
function getFullQueues() {
|
|
6534
|
+
return getStatus(this[QUEUE_SYMBOL], QUEUE_STATUS_FULL);
|
|
6535
|
+
}
|
|
6536
|
+
function getPausedQueues() {
|
|
6537
|
+
return getStatus(this[QUEUE_SYMBOL], QUEUE_STATUS_PAUSED);
|
|
6538
|
+
}
|
|
6539
|
+
function getKeyedQueueItems() {
|
|
6540
|
+
const state = this[QUEUE_SYMBOL];
|
|
6541
|
+
const size = {};
|
|
6542
|
+
const queues = state.queues.entries();
|
|
6543
|
+
for (const [key, queue] of queues) size[key] = queue.size;
|
|
6544
|
+
return size;
|
|
6545
|
+
}
|
|
6546
|
+
function getKeyedQueueSize() {
|
|
6547
|
+
return this[QUEUE_SYMBOL].queues.size;
|
|
6548
|
+
}
|
|
6620
6549
|
function getQueue(key, add) {
|
|
6621
6550
|
if (typeof key !== "string" || key.trim().length === 0) throw new TypeError(QUEUE_MESSAGE_KEY);
|
|
6622
6551
|
const state = this[QUEUE_SYMBOL];
|
|
@@ -6627,11 +6556,33 @@ function getQueue(key, add) {
|
|
|
6627
6556
|
}
|
|
6628
6557
|
return queue;
|
|
6629
6558
|
}
|
|
6630
|
-
function
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
return
|
|
6559
|
+
function getQueueActive() {
|
|
6560
|
+
return this[QUEUE_SYMBOL].runners > 0;
|
|
6561
|
+
}
|
|
6562
|
+
function getQueueAutostart() {
|
|
6563
|
+
return this[QUEUE_SYMBOL].options.autostart === true;
|
|
6564
|
+
}
|
|
6565
|
+
function getQueueConcurrency() {
|
|
6566
|
+
return this[QUEUE_SYMBOL].options.concurrency;
|
|
6567
|
+
}
|
|
6568
|
+
function getQueueEmpty() {
|
|
6569
|
+
return this[QUEUE_SYMBOL].items.length === 0;
|
|
6570
|
+
}
|
|
6571
|
+
function getQueueFull() {
|
|
6572
|
+
const state = this[QUEUE_SYMBOL];
|
|
6573
|
+
return state.options.maximum > 0 && state.items.length >= state.options.maximum;
|
|
6574
|
+
}
|
|
6575
|
+
function getQueueKeys() {
|
|
6576
|
+
return [...this[QUEUE_SYMBOL].queues.keys()];
|
|
6577
|
+
}
|
|
6578
|
+
function getQueueMaximum() {
|
|
6579
|
+
return this[QUEUE_SYMBOL].options.maximum;
|
|
6580
|
+
}
|
|
6581
|
+
function getQueuePaused() {
|
|
6582
|
+
return this[QUEUE_SYMBOL].paused === true;
|
|
6583
|
+
}
|
|
6584
|
+
function getQueueSize() {
|
|
6585
|
+
return this[QUEUE_SYMBOL].items.length;
|
|
6635
6586
|
}
|
|
6636
6587
|
function getStatus(state, status) {
|
|
6637
6588
|
const queues = state.queues.entries();
|
|
@@ -6777,7 +6728,6 @@ const QUEUE_STATUS_FULL = "full";
|
|
|
6777
6728
|
const QUEUE_STATUS_PAUSED = "paused";
|
|
6778
6729
|
const QUEUE_SYMBOL = Symbol(QUEUE_PROPERTY);
|
|
6779
6730
|
queue.keyed = keyedQueue;
|
|
6780
|
-
Object.defineProperty(queue, "keyed", { value: keyedQueue });
|
|
6781
6731
|
//#endregion
|
|
6782
6732
|
//#region src/random.ts
|
|
6783
6733
|
/**
|
|
@@ -6895,4 +6845,4 @@ var SizedSet = class extends Set {
|
|
|
6895
6845
|
}
|
|
6896
6846
|
};
|
|
6897
6847
|
//#endregion
|
|
6898
|
-
export { CancelablePromise, Logger, PromiseTimeoutError, QueueError, RetryError, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING, SizedMap, SizedSet, assert, assertCondition, assertDefined, assertInstanceOf, assertIs, assertProperty, assign, asyncAttempt, asyncDebounce, asyncFlow, asyncMatchResult, asyncOnce, asyncPipe, asyncThrottle, attempt, attemptAsyncFlow, attemptAsyncPipe, attemptFlow, attemptPipe, attemptPromise, average, beacon, between, camelCase, cancelable, capitalize, ceil, chunk, clamp, clone, compact, compare, copy, count, debounce, deburr, dedent, delay, deregisterCloner, deregisterComparator, deregisterEqualizer, diff, difference, drop, endsWith, endsWithArray, equal, error, exclude, exists, filter, find, findLast, first, firstOrDefault, flatFreeze, flatten, floor, flow, freeze, fromQuery, toPromise as fromResult, toPromise, fuzzy, fuzzyMatch, getArray, getArrayComparison, getColor, getForegroundColor, getHexColor, getHexaColor, getHslColor, getHslaColor, getHwbColor, getHwbaColor, getNormalizedHex, getNumber, getRandomBoolean, getRandomCharacters, getRandomColor, getRandomFloatingNumber as getRandomFloat, getRandomHex, getRandomInteger, getRandomItem, getRandomItems, getRgbColor, getRgbaColor, getSortedIndex, getString, getTimedPromise, getUuid, getValue, groupArraysBy, groupBy, handleResult, hasValue, hasValueResult, herald, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, hexToRgba, hslToHex, hslToHwb, hslToHwba, hslToRgb, hslToRgba, hwbToHex, hwbToHsl, hwbToHsla, hwbToRgb, hwbToRgba, ignoreKey, inMap, inSet, includes, includesArray, indexOf, indexOfArray, initializeAssigner, initializeCloner, initializeEqualizer, initializeMerger, initializeNormalizer, initializeSorter, initializeTemplater, initializeTransformer, insert, interpolate, intersection, isArrayOrPlainObject, isAsyncOnce, isBeacon, isBeaconSubscription, isColor, isConstructor, isEmpty, isError, isFrozen, isFulfilled, isFuzzy, isHerald, isHeraldEvents, isHeraldSubscription, isHexColor, isHslColor, isHslaColor, isHwbColor, isHwbaColor, isInstanceOf, isKey, isKeyedQueue, isLogger, isNonArrayOrPlainObject, isNonConstructor, isNonEmpty, isNonInstanceOf, isNonKey, isNonNullable, isNonNullableOrEmpty, isNonNullableOrWhitespace, isNonNumber, isNonNumerical, isNonObject, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNullable, isNullableOrEmpty, isNullableOrWhitespace, isNumber, isNumerical, isObject, isObservable, isOk, isOnce, isPlainObject, isPrimitive, isQueue, isQueueInstance, isRejected, isResult, isRgbColor, isRgbaColor, isSorted, isSubscription, isSubscriptions, isTimeLogger, isTypedArray, join, kebabCase, keyedQueue, last, lastIndexOf, lastOrDefault, lowerCase, matchResult, max, median, memoize, merge, min, move, moveIndices, moveToIndex, noop, normalize, ok, omit, once, parse, partition, pascalCase, pick, pipe, promises, push, queue, range, registerCloner, registerComparator, registerEqualizer, resultPromises, retry, reverse, reverseSelect, rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba, round, select, setValue, settlePromise, shake, shuffle, single, slice, smush, snakeCase, sort, splice, startsWith, startsWithArray, subscriptions, sum, swap, take, template, throttle, timed, times, titleCase, toMap, toMapArrays, toQuery, toRecord, toRecordArrays, toResult, toSet, toggle, transform, trim, truncate, tryDecode, tryEncode, union, unique, unsmush, unwrap, update, upperCase, words };
|
|
6848
|
+
export { CancelablePromise, Logger, PromiseTimeoutError, QueueError, RetryError, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING, SizedMap, SizedSet, assert, assertCondition, assertDefined, assertInstanceOf, assertIs, assertProperty, assign, asyncAttempt, asyncDebounce, asyncFlow, asyncMatchResult, asyncOnce, asyncPipe, asyncThrottle, attempt, attemptAsyncFlow, attemptAsyncPipe, attemptFlow, attemptPipe, attemptPromise, average, beacon, between, camelCase, cancelable, capitalize, ceil, chunk, clamp, clone, compact, compare, copy, count, debounce, deburr, dedent, delay, deregisterCloner, deregisterComparator, deregisterEqualizer, diff, difference, drop, endsWith, endsWithArray, equal, error, exclude, exists, filter, find, findLast, first, firstOrDefault, flatFreeze, flatten, floor, flow, freeze, fromQuery, toPromise as fromResult, toPromise, fuzzy, fuzzyMatch, getArray, getArrayComparison, getColor, getForegroundColor, getHexColor, getHexaColor, getHslColor, getHslaColor, getHwbColor, getHwbaColor, getNormalizedHex, getNumber, getRandomBoolean, getRandomCharacters, getRandomColor, getRandomFloatingNumber as getRandomFloat, getRandomHex, getRandomInteger, getRandomItem, getRandomItems, getRgbColor, getRgbaColor, getSortedIndex, getString, getTimedPromise, getUuid, getValue, groupArraysBy, groupBy, handleResult, hasValue, hasValueResult, herald, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, hexToRgba, hslToHex, hslToHwb, hslToHwba, hslToRgb, hslToRgba, hwbToHex, hwbToHsl, hwbToHsla, hwbToRgb, hwbToRgba, ignoreKey, inMap, inSet, includes, includesArray, indexOf, indexOfArray, initializeAssigner, initializeCloner, initializeEqualizer, initializeMerger, initializeNormalizer, initializeSorter, initializeTemplater, initializeTransformer, insert, interpolate, intersection, isArrayOrPlainObject, isAsyncOnce, isBeacon, isBeaconSubscription, isColor, isConstructor, isEmpty, isError, isFrozen, isFulfilled, isFuzzy, isHerald, isHeraldEvents, isHeraldSubscription, isHexColor, isHslColor, isHslaColor, isHwbColor, isHwbaColor, isInstanceOf, isKey, isKeyedQueue, isLogger, isNonArrayOrPlainObject, isNonConstructor, isNonEmpty, isNonInstanceOf, isNonKey, isNonNullable, isNonNullableOrEmpty, isNonNullableOrWhitespace, isNonNumber, isNonNumerical, isNonObject, isNonPlainObject, isNonPrimitive, isNonTemplateStringsArray, isNonTypedArray, isNullable, isNullableOrEmpty, isNullableOrWhitespace, isNumber, isNumerical, isObject, isObservable, isOk, isOnce, isPlainObject, isPrimitive, isQueue, isQueueInstance, isRejected, isResult, isRgbColor, isRgbaColor, isSorted, isSubscription, isSubscriptions, isTemplateStringsArray, isTimeLogger, isTypedArray, join, kebabCase, keyedQueue, last, lastIndexOf, lastOrDefault, lowerCase, matchResult, max, median, memoize, merge, min, move, moveIndices, moveToIndex, noop, normalize, ok, omit, once, parse, partition, pascalCase, pick, pipe, promises, push, queue, range, registerCloner, registerComparator, registerEqualizer, resultPromises, retry, reverse, reverseSelect, rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba, round, select, setValue, settlePromise, shake, shuffle, single, slice, smush, snakeCase, sort, splice, startsWith, startsWithArray, subscriptions, sum, swap, take, template, throttle, timed, times, titleCase, toMap, toMapArrays, toQuery, toRecord, toRecordArrays, toResult, toSet, toggle, transform, trim, truncate, tryDecode, tryEncode, union, unique, unsmush, unwrap, update, upperCase, words };
|