@oscarpalmer/atoms 0.222.0 → 0.223.0
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/difference.mjs +1 -1
- package/dist/array/exists.mjs +10 -4
- package/dist/array/filter.mjs +14 -4
- package/dist/array/find.mjs +8 -3
- package/dist/array/first.mjs +9 -3
- package/dist/array/index.d.mts +4 -4
- package/dist/array/insert.mjs +1 -1
- package/dist/array/intersection.mjs +1 -1
- package/dist/array/last.mjs +11 -3
- package/dist/array/partition.mjs +23 -3
- package/dist/array/push.mjs +1 -1
- package/dist/array/select.mjs +39 -7
- package/dist/array/single.mjs +8 -5
- package/dist/array/sort.mjs +1 -1
- package/dist/array/splice.mjs +1 -1
- package/dist/array/swap.mjs +1 -1
- package/dist/array/union.mjs +1 -1
- package/dist/array/unique.mjs +17 -3
- package/dist/beacon.d.mts +3 -11
- package/dist/beacon.mjs +10 -20
- package/dist/color/constants.d.mts +1 -5
- package/dist/color/constants.mjs +2 -9
- package/dist/color/index.mjs +3 -3
- package/dist/color/instance.mjs +4 -6
- package/dist/color/misc/get.mjs +1 -1
- package/dist/color/misc/is.d.mts +0 -8
- package/dist/color/misc/is.mjs +3 -14
- package/dist/color/misc/state.mjs +3 -3
- package/dist/color/space/hex.mjs +1 -1
- package/dist/color/space/hsl.mjs +1 -1
- package/dist/color/space/hwb.mjs +2 -2
- package/dist/function/limit.d.mts +1 -1
- package/dist/function/limit.mjs +1 -1
- package/dist/function/once.d.mts +1 -1
- package/dist/function/once.mjs +7 -7
- package/dist/function/retry.d.mts +1 -1
- package/dist/function/retry.mjs +10 -10
- package/dist/herald.d.mts +2 -2
- package/dist/herald.mjs +1 -1
- package/dist/index.d.mts +80 -91
- package/dist/index.mjs +352 -334
- package/dist/internal/array/callbacks.d.mts +1 -1
- package/dist/internal/array/find.d.mts +2 -6
- package/dist/internal/array/find.mjs +30 -122
- package/dist/internal/array/index-of.mjs +9 -3
- package/dist/internal/array/insert.mjs +1 -1
- package/dist/internal/array/match.d.mts +1 -1
- package/dist/internal/array/match.mjs +1 -1
- package/dist/internal/array/sets.mjs +4 -4
- package/dist/internal/function/assert.d.mts +1 -1
- package/dist/internal/function/limit.d.mts +1 -1
- package/dist/internal/function/limit.mjs +7 -7
- package/dist/internal/function/memoize.d.mts +1 -1
- package/dist/internal/function/memoize.mjs +3 -3
- package/dist/internal/function/work.d.mts +1 -1
- package/dist/internal/function/work.mjs +1 -1
- package/dist/internal/herald.d.mts +2 -10
- package/dist/internal/herald.mjs +8 -31
- package/dist/internal/math/aggregate.mjs +1 -1
- package/dist/internal/number.mjs +1 -1
- package/dist/internal/plan/index.mjs +1 -1
- package/dist/internal/plan/plan.generate.mjs +67 -21
- package/dist/internal/sized/map.d.mts +3 -0
- package/dist/internal/sized/map.mjs +3 -0
- package/dist/internal/string/case.mjs +2 -2
- package/dist/internal/string/misc.mjs +1 -1
- package/dist/internal/subscription.mjs +15 -27
- package/dist/internal/value/compare.mjs +1 -1
- package/dist/internal/value/equal.d.mts +1 -1
- package/dist/internal/value/equal.mjs +2 -2
- package/dist/internal/value/set.mjs +1 -1
- package/dist/is.mjs +1 -1
- package/dist/logger.mjs +6 -5
- package/dist/math.mjs +1 -1
- package/dist/models/array/array.misc.model.d.mts +12 -1
- package/dist/models/array/array.misc.model.mjs +2 -1
- package/dist/models/beacon.model.d.mts +4 -4
- package/dist/models/beacon.model.mjs +2 -8
- package/dist/models/color.model.d.mts +2 -2
- package/dist/models/function/limiter.model.d.mts +1 -1
- package/dist/models/function/limiter.model.mjs +1 -2
- package/dist/models/function/memoize.model.d.mts +1 -1
- package/dist/models/function/once.model.d.mts +0 -1
- package/dist/models/function/once.model.mjs +2 -3
- package/dist/models/function/work.model.d.mts +1 -1
- package/dist/models/herald.model.d.mts +8 -5
- package/dist/models/herald.model.mjs +2 -8
- package/dist/models/logger.model.d.mts +0 -1
- package/dist/models/logger.model.mjs +2 -3
- package/dist/models/plan.model.d.mts +35 -35
- package/dist/models/promise.model.d.mts +7 -7
- package/dist/models/promise.model.mjs +3 -3
- package/dist/models/queue.model.d.mts +0 -1
- package/dist/models/queue.model.mjs +2 -3
- package/dist/models/string/string.fuzzy.model.d.mts +0 -1
- package/dist/models/string/string.fuzzy.model.mjs +2 -3
- package/dist/models/subscription.model.d.mts +3 -20
- package/dist/models/subscription.model.mjs +2 -3
- package/dist/plan/index.mjs +1 -1
- package/dist/plan/misc.mjs +1 -1
- package/dist/plan/models.d.mts +2 -2
- package/dist/plan/result.d.mts +7 -7
- package/dist/plan/result.mjs +1 -1
- package/dist/plan/run.d.mts +7 -7
- package/dist/plan/run.mjs +1 -1
- package/dist/plan/use.mjs +13 -7
- package/dist/promise/delay.mjs +1 -1
- package/dist/promise/helpers.mjs +1 -1
- package/dist/promise/index.mjs +4 -4
- package/dist/promise/misc.d.mts +1 -1
- package/dist/promise/misc.mjs +1 -1
- package/dist/promise/models.d.mts +2 -2
- package/dist/promise/models.mjs +1 -1
- package/dist/promise/timed.mjs +3 -3
- package/dist/query.mjs +1 -1
- package/dist/queue.mjs +10 -10
- package/dist/random.mjs +1 -1
- package/dist/result/work/flow.mjs +1 -1
- package/dist/result/work/pipe.mjs +1 -1
- package/dist/sized/set.d.mts +3 -0
- package/dist/sized/set.mjs +3 -0
- package/dist/string/fuzzy.mjs +4 -5
- package/dist/string/index.mjs +1 -1
- package/dist/string/match.mjs +1 -1
- package/dist/string/normalize.mjs +2 -2
- package/dist/subscription.d.mts +2 -2
- package/dist/value/clone.d.mts +1 -1
- package/dist/value/clone.mjs +1 -1
- package/dist/value/freeze.mjs +1 -1
- package/dist/value/handle.mjs +1 -1
- package/dist/value/smush.mjs +1 -1
- package/package.json +6 -6
- package/dist/models/array/array.find.model.d.mts +0 -46
- package/dist/models/array/array.find.model.mjs +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ARRAY_SETS_COMPARE_DIFFERENCE } from "../models/array/array.misc.model.mjs";
|
|
2
1
|
import { compareSets } from "../internal/array/sets.mjs";
|
|
2
|
+
import { ARRAY_SETS_COMPARE_DIFFERENCE } from "../models/array/array.misc.model.mjs";
|
|
3
3
|
// src/array/difference.ts
|
|
4
4
|
function difference(first, second, key) {
|
|
5
5
|
return compareSets(ARRAY_SETS_COMPARE_DIFFERENCE, first, second, key);
|
package/dist/array/exists.mjs
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { ARRAY_FIND_VALUE_INDEX } from "../models/array/array.find.model.mjs";
|
|
2
|
-
import { findValue } from "../internal/array/find.mjs";
|
|
3
1
|
// src/array/exists.ts
|
|
4
2
|
function exists(array, ...parameters) {
|
|
5
|
-
if (
|
|
6
|
-
|
|
3
|
+
if (!Array.isArray(array)) return false;
|
|
4
|
+
if (array.length === 0) return false;
|
|
5
|
+
const [first, second] = parameters;
|
|
6
|
+
const { length } = parameters;
|
|
7
|
+
if (length === 1) return typeof first === "function" ? array.some((item, index, array) => first(item, index, array)) : array.includes(first);
|
|
8
|
+
let callback;
|
|
9
|
+
if (typeof first === "function") callback = first;
|
|
10
|
+
else if (typeof first === "number" || typeof first === "string") callback = (item) => item[first];
|
|
11
|
+
if (callback == null) return false;
|
|
12
|
+
return array.some((item, index, array) => Object.is(callback(item, index, array), second));
|
|
7
13
|
}
|
|
8
14
|
export { exists };
|
package/dist/array/filter.mjs
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import "../models/array/array.find.model.mjs";
|
|
2
|
-
import { findValues } from "../internal/array/find.mjs";
|
|
3
1
|
// src/array/filter.ts
|
|
4
2
|
function exclude(array, ...parameters) {
|
|
5
|
-
return
|
|
3
|
+
return filterValues(array, parameters, false);
|
|
6
4
|
}
|
|
7
5
|
function filter(array, ...parameters) {
|
|
8
|
-
return
|
|
6
|
+
return filterValues(array, parameters, true);
|
|
7
|
+
}
|
|
8
|
+
function filterValues(array, parameters, include) {
|
|
9
|
+
if (!Array.isArray(array)) return [];
|
|
10
|
+
if (array.length === 0) return [];
|
|
11
|
+
const [first, second] = parameters;
|
|
12
|
+
const { length } = parameters;
|
|
13
|
+
if (length === 1) return typeof first === "function" ? array.filter((item, index, array) => first(item, index, array) === include) : array.filter((item) => Object.is(item, first) === include);
|
|
14
|
+
let callback;
|
|
15
|
+
if (typeof first === "function") callback = first;
|
|
16
|
+
else if (typeof first === "number" || typeof first === "string") callback = (item) => item[first];
|
|
17
|
+
if (callback == null) return [];
|
|
18
|
+
return array.filter((item, index, array) => Object.is(callback(item, index, array), second) === include);
|
|
9
19
|
}
|
|
10
20
|
filter.remove = exclude;
|
|
11
21
|
export { exclude, filter };
|
package/dist/array/find.mjs
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { ARRAY_FIND_VALUE_ITEM } from "../models/array/array.find.model.mjs";
|
|
2
1
|
import { findValue } from "../internal/array/find.mjs";
|
|
3
2
|
// src/array/find.ts
|
|
4
3
|
function find(array, ...parameters) {
|
|
5
|
-
return findValue(
|
|
4
|
+
return findValue(array, {
|
|
5
|
+
input: parameters,
|
|
6
|
+
reverse: false
|
|
7
|
+
})?.values[0];
|
|
6
8
|
}
|
|
7
9
|
function findLast(array, ...parameters) {
|
|
8
|
-
return findValue(
|
|
10
|
+
return findValue(array, {
|
|
11
|
+
input: parameters,
|
|
12
|
+
reverse: true
|
|
13
|
+
})?.values[0];
|
|
9
14
|
}
|
|
10
15
|
find.last = findLast;
|
|
11
16
|
export { find, findLast };
|
package/dist/array/first.mjs
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { findValue } from "../internal/array/find.mjs";
|
|
2
2
|
// src/array/first.ts
|
|
3
3
|
function first(array, ...parameters) {
|
|
4
|
-
return
|
|
4
|
+
return findValue(array, {
|
|
5
|
+
bare: true,
|
|
6
|
+
input: parameters
|
|
7
|
+
})?.values[0];
|
|
5
8
|
}
|
|
6
9
|
function firstOrDefault(array, defaultValue, ...parameters) {
|
|
7
|
-
return
|
|
10
|
+
return findValue(array, {
|
|
11
|
+
bare: true,
|
|
12
|
+
input: parameters
|
|
13
|
+
})?.values[0] ?? defaultValue;
|
|
8
14
|
}
|
|
9
15
|
first.defaulted = firstOrDefault;
|
|
10
16
|
export { first, firstOrDefault };
|
package/dist/array/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { difference } from "./difference.mjs";
|
|
2
|
-
import { exists } from "./exists.mjs";
|
|
3
|
-
import { flatten } from "./flatten.mjs";
|
|
4
|
-
import { range, times } from "./from.mjs";
|
|
5
1
|
import { chunk } from "../internal/array/chunk.mjs";
|
|
6
2
|
import { compact } from "../internal/array/compact.mjs";
|
|
7
3
|
import { getArray } from "../internal/array/get.mjs";
|
|
8
4
|
import { endsWithArray, getArrayComparison, includesArray, indexOfArray, startsWithArray } from "../internal/array/match.mjs";
|
|
9
5
|
import { shuffle } from "../internal/array/shuffle.mjs";
|
|
6
|
+
import { difference } from "./difference.mjs";
|
|
7
|
+
import { exists } from "./exists.mjs";
|
|
8
|
+
import { flatten } from "./flatten.mjs";
|
|
9
|
+
import { range, times } from "./from.mjs";
|
|
10
10
|
import { insert } from "./insert.mjs";
|
|
11
11
|
import { intersection } from "./intersection.mjs";
|
|
12
12
|
import { partition } from "./partition.mjs";
|
package/dist/array/insert.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ARRAY_INSERT_TYPE_INSERT } from "../models/array/array.misc.model.mjs";
|
|
2
1
|
import { insertValues } from "../internal/array/insert.mjs";
|
|
2
|
+
import { ARRAY_INSERT_TYPE_INSERT } from "../models/array/array.misc.model.mjs";
|
|
3
3
|
// src/array/insert.ts
|
|
4
4
|
function insert(array, indexOrItems, items) {
|
|
5
5
|
return insertValues(ARRAY_INSERT_TYPE_INSERT, array, items ?? indexOrItems, typeof indexOrItems === "number" ? indexOrItems : array?.length, 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ARRAY_SETS_COMPARE_INTERSECTION } from "../models/array/array.misc.model.mjs";
|
|
2
1
|
import { compareSets } from "../internal/array/sets.mjs";
|
|
2
|
+
import { ARRAY_SETS_COMPARE_INTERSECTION } from "../models/array/array.misc.model.mjs";
|
|
3
3
|
// src/array/intersection.ts
|
|
4
4
|
function intersection(first, second, key) {
|
|
5
5
|
return compareSets(ARRAY_SETS_COMPARE_INTERSECTION, first, second, key);
|
package/dist/array/last.mjs
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { findValue } from "../internal/array/find.mjs";
|
|
2
2
|
// src/array/last.ts
|
|
3
3
|
function last(array, ...parameters) {
|
|
4
|
-
return
|
|
4
|
+
return findValue(array, {
|
|
5
|
+
bare: true,
|
|
6
|
+
input: parameters,
|
|
7
|
+
reverse: true
|
|
8
|
+
})?.values[0];
|
|
5
9
|
}
|
|
6
10
|
function lastOrDefault(array, defaultValue, ...parameters) {
|
|
7
|
-
return
|
|
11
|
+
return findValue(array, {
|
|
12
|
+
bare: true,
|
|
13
|
+
input: parameters,
|
|
14
|
+
reverse: true
|
|
15
|
+
})?.values[0] ?? defaultValue;
|
|
8
16
|
}
|
|
9
17
|
last.defaulted = lastOrDefault;
|
|
10
18
|
export { last, lastOrDefault };
|
package/dist/array/partition.mjs
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
|
-
import "../models/array/array.find.model.mjs";
|
|
2
|
-
import { findValues } from "../internal/array/find.mjs";
|
|
3
1
|
// src/array/partition.ts
|
|
2
|
+
function getCallback(first, second, length) {
|
|
3
|
+
if (length === 1 && typeof first === "function") return first;
|
|
4
|
+
switch (true) {
|
|
5
|
+
case length === 1: return (item) => Object.is(item, first);
|
|
6
|
+
case typeof first === "function": return (item, index, array) => Object.is(first(item, index, array), second);
|
|
7
|
+
case typeof first === "number" || typeof first === "string": return (item) => Object.is(item[first], second);
|
|
8
|
+
default: return;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
4
11
|
function partition(array, ...parameters) {
|
|
5
|
-
|
|
12
|
+
if (!Array.isArray(array)) return [[], []];
|
|
13
|
+
const arrayLength = array.length;
|
|
14
|
+
if (arrayLength === 0) return [[], []];
|
|
15
|
+
const parametersLength = parameters.length;
|
|
16
|
+
const [first, second] = parameters;
|
|
17
|
+
const callback = getCallback(first, second, parametersLength);
|
|
18
|
+
if (callback == null) return [[], []];
|
|
19
|
+
const matched = [];
|
|
20
|
+
const notMatched = [];
|
|
21
|
+
for (let index = 0; index < arrayLength; index += 1) {
|
|
22
|
+
const item = array[index];
|
|
23
|
+
if (callback(item, index, array)) matched.push(item);
|
|
24
|
+
else notMatched.push(item);
|
|
25
|
+
}
|
|
6
26
|
return [matched, notMatched];
|
|
7
27
|
}
|
|
8
28
|
export { partition };
|
package/dist/array/push.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ARRAY_INSERT_TYPE_PUSH } from "../models/array/array.misc.model.mjs";
|
|
2
1
|
import { insertValues } from "../internal/array/insert.mjs";
|
|
2
|
+
import { ARRAY_INSERT_TYPE_PUSH } from "../models/array/array.misc.model.mjs";
|
|
3
3
|
// src/array/push.ts
|
|
4
4
|
/**
|
|
5
5
|
* Push items into an array _(at the end)_
|
package/dist/array/select.mjs
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "../models/array/array.find.model.mjs";
|
|
2
|
-
import { findValues } from "../internal/array/find.mjs";
|
|
3
1
|
// src/array/select.ts
|
|
4
2
|
function filterAndFlatMap(array, filter, mapper) {
|
|
5
3
|
return selectValues(array, filter, mapper, true, false);
|
|
@@ -13,12 +11,46 @@ function flatMapAndFilter(array, mapper, filter) {
|
|
|
13
11
|
function mapAndFilter(array, mapper, filter) {
|
|
14
12
|
return selectValues(array, filter, mapper, false, true);
|
|
15
13
|
}
|
|
14
|
+
function selectBareValues(array, length, filter, mapper, reverse) {
|
|
15
|
+
const selected = [];
|
|
16
|
+
for (let index = 0; index < length; index += 1) {
|
|
17
|
+
const item = array[index];
|
|
18
|
+
const mapped = reverse ? mapper(item, index, array) : item;
|
|
19
|
+
if (filter(mapped, index, array)) selected.push(reverse ? mapped : mapper(item, index, array));
|
|
20
|
+
}
|
|
21
|
+
return selected;
|
|
22
|
+
}
|
|
23
|
+
function selectFlatValues(array, arrayLength, filter, mapper, reverse) {
|
|
24
|
+
if (reverse) return selectFlatValuesReversed(array, arrayLength, filter, mapper);
|
|
25
|
+
const selected = [];
|
|
26
|
+
for (let arrayIndex = 0; arrayIndex < arrayLength; arrayIndex += 1) {
|
|
27
|
+
const item = array[arrayIndex];
|
|
28
|
+
if (!filter(item, arrayIndex, array)) continue;
|
|
29
|
+
const mapped = mapper(item, arrayIndex, array);
|
|
30
|
+
if (Array.isArray(mapped)) selected.push(...mapped);
|
|
31
|
+
else selected.push(mapped);
|
|
32
|
+
}
|
|
33
|
+
return selected;
|
|
34
|
+
}
|
|
35
|
+
function selectFlatValuesReversed(array, arrayLength, filter, mapper) {
|
|
36
|
+
const selected = [];
|
|
37
|
+
for (let arrayIndex = 0; arrayIndex < arrayLength; arrayIndex += 1) {
|
|
38
|
+
const item = array[arrayIndex];
|
|
39
|
+
const mapped = mapper(item, arrayIndex, array);
|
|
40
|
+
const items = Array.isArray(mapped) ? mapped : [mapped];
|
|
41
|
+
const itemsLength = items.length;
|
|
42
|
+
for (let itemsIndex = 0; itemsIndex < itemsLength; itemsIndex += 1) {
|
|
43
|
+
const item = items[itemsIndex];
|
|
44
|
+
if (filter(item, arrayIndex, array)) selected.push(item);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return selected;
|
|
48
|
+
}
|
|
16
49
|
function selectValues(array, filter, mapper, flat, reverse) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} }).matched;
|
|
50
|
+
if (!Array.isArray(array) || typeof filter !== "function" || typeof mapper !== "function") return [];
|
|
51
|
+
const { length } = array;
|
|
52
|
+
if (length === 0) return [];
|
|
53
|
+
return flat ? selectFlatValues(array, length, filter, mapper, reverse) : selectBareValues(array, length, filter, mapper, reverse);
|
|
22
54
|
}
|
|
23
55
|
filterAndMap.flat = filterAndFlatMap;
|
|
24
56
|
filterAndMap.reverse = mapAndFilter;
|
package/dist/array/single.mjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import { findValues } from "../internal/array/find.mjs";
|
|
1
|
+
import { findValue } from "../internal/array/find.mjs";
|
|
3
2
|
// src/array/single.ts
|
|
4
3
|
function single(array, ...parameters) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const result = findValue(array, {
|
|
5
|
+
input: parameters,
|
|
6
|
+
limit: 2
|
|
7
|
+
});
|
|
8
|
+
if (result == null) return;
|
|
9
|
+
if (result.values.length > 1) throw new Error(SINGLE_MESSAGE);
|
|
10
|
+
return result.values[0];
|
|
8
11
|
}
|
|
9
12
|
const SINGLE_MESSAGE = "Multiple items were found";
|
|
10
13
|
export { single };
|
package/dist/array/sort.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPlainObject } from "../internal/is.mjs";
|
|
2
|
-
import { floor, round } from "../internal/math/misc.mjs";
|
|
3
2
|
import { min } from "../internal/math/aggregate.mjs";
|
|
3
|
+
import { floor, round } from "../internal/math/misc.mjs";
|
|
4
4
|
import { compare } from "../internal/value/compare.mjs";
|
|
5
5
|
import { SORTER_SYMBOL, SORT_DIRECTION_ASCENDING, SORT_DIRECTION_DESCENDING, arrayModifiers } from "../models/array/array.sort.model.mjs";
|
|
6
6
|
// src/array/sort.ts
|
package/dist/array/splice.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ARRAY_INSERT_TYPE_SPLICE } from "../models/array/array.misc.model.mjs";
|
|
2
1
|
import { insertValues } from "../internal/array/insert.mjs";
|
|
2
|
+
import { ARRAY_INSERT_TYPE_SPLICE } from "../models/array/array.misc.model.mjs";
|
|
3
3
|
// src/array/splice.ts
|
|
4
4
|
function splice(array, start, deleteCountOrItems, items) {
|
|
5
5
|
const deleteCountIsNumber = typeof deleteCountOrItems === "number";
|
package/dist/array/swap.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getArrayCallback } from "../internal/array/callbacks.mjs";
|
|
2
|
+
import { indexOf } from "../internal/array/index-of.mjs";
|
|
2
3
|
import { indexOfArray } from "../internal/array/match.mjs";
|
|
3
4
|
import { arraysOverlap } from "../internal/array/overlap.mjs";
|
|
4
|
-
import { indexOf } from "../internal/array/index-of.mjs";
|
|
5
5
|
// src/array/swap.ts
|
|
6
6
|
function swap(array, first, second, third) {
|
|
7
7
|
if (!Array.isArray(array)) return [];
|
package/dist/array/union.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ARRAY_SETS_COMPARE_UNION } from "../models/array/array.misc.model.mjs";
|
|
2
1
|
import { compareSets } from "../internal/array/sets.mjs";
|
|
2
|
+
import { ARRAY_SETS_COMPARE_UNION } from "../models/array/array.misc.model.mjs";
|
|
3
3
|
// src/array/union.ts
|
|
4
4
|
function union(first, second, key) {
|
|
5
5
|
return compareSets(ARRAY_SETS_COMPARE_UNION, first, second, key);
|
package/dist/array/unique.mjs
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { getArrayCallback } from "../internal/array/callbacks.mjs";
|
|
2
|
+
import "../models/array/array.misc.model.mjs";
|
|
3
3
|
// src/array/unique.ts
|
|
4
4
|
function unique(array, key) {
|
|
5
5
|
if (!Array.isArray(array)) return [];
|
|
6
|
-
|
|
6
|
+
const { length } = array;
|
|
7
|
+
if (length < 2) return array.slice();
|
|
8
|
+
const callback = getArrayCallback(key);
|
|
9
|
+
if (callback == null && length >= 100) return [...new Set(array)];
|
|
10
|
+
const keyed = /* @__PURE__ */ new Set();
|
|
11
|
+
const uniques = [];
|
|
12
|
+
for (let index = 0; index < length; index += 1) {
|
|
13
|
+
const item = array[index];
|
|
14
|
+
const value = callback == null ? item : callback(item, index, array);
|
|
15
|
+
if (!keyed.has(value)) {
|
|
16
|
+
keyed.add(value);
|
|
17
|
+
uniques.push(item);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return uniques;
|
|
7
21
|
}
|
|
8
22
|
export { unique };
|
package/dist/beacon.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare function
|
|
4
|
-
declare function Observable(this: any, beacon: BeaconState<unknown>): void;
|
|
1
|
+
import { Beacon, BeaconOptions, BeaconState, InternalBeacon, InternalObservable, Observable, Observer } from "./models/beacon.model.mjs";
|
|
2
|
+
declare function Beacon(this: InternalBeacon, value: unknown, options?: BeaconOptions<unknown>): void;
|
|
3
|
+
declare function Observable(this: InternalObservable, beacon: BeaconState<unknown>): void;
|
|
5
4
|
/**
|
|
6
5
|
* Create a new beacon
|
|
7
6
|
*
|
|
@@ -17,13 +16,6 @@ export declare function beacon<Value>(value: Value, options?: BeaconOptions<Valu
|
|
|
17
16
|
* @returns `true` if the value is a beacon, otherwise `false`
|
|
18
17
|
*/
|
|
19
18
|
export declare function isBeacon<Value = unknown>(value: unknown): value is Beacon<Value>;
|
|
20
|
-
/**
|
|
21
|
-
* Is the value a beacon subscription?
|
|
22
|
-
*
|
|
23
|
-
* @param value Value to check
|
|
24
|
-
* @returns `true` if the value is a beacon subscription, otherwise `false`
|
|
25
|
-
*/
|
|
26
|
-
export declare function isBeaconSubscription(value: unknown): value is Subscription;
|
|
27
19
|
/**
|
|
28
20
|
* Is the value an observable?
|
|
29
21
|
*
|
package/dist/beacon.mjs
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { isPlainObject } from "./internal/is.mjs";
|
|
2
1
|
import { noop } from "./internal/function/misc.mjs";
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import { BEACON_MESSAGE_RETRIEVE, BEACON_MESSAGE_SUBSCRIBE, BEACON_NAME, BEACON_OBSERVABLE,
|
|
2
|
+
import { isPlainObject } from "./internal/is.mjs";
|
|
3
|
+
import { subscriptions } from "./internal/subscription.mjs";
|
|
4
|
+
import { BEACON_MESSAGE_RETRIEVE, BEACON_MESSAGE_SUBSCRIBE, BEACON_NAME, BEACON_OBSERVABLE, BEACON_SYMBOL, BEACON_TYPE_ERROR, BEACON_TYPE_NEXT } from "./models/beacon.model.mjs";
|
|
6
5
|
// src/beacon.ts
|
|
7
6
|
function Beacon(value, options) {
|
|
8
7
|
this[BEACON_SYMBOL] = {
|
|
9
8
|
value,
|
|
10
9
|
active: true,
|
|
11
|
-
options: createBeaconOptions(options)
|
|
10
|
+
options: createBeaconOptions(options),
|
|
11
|
+
name: BEACON_NAME
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
Beacon.prototype[BEACON_PROPERTY] = BEACON_NAME;
|
|
15
14
|
Beacon.prototype.deactivate = deactivateBeacon;
|
|
16
15
|
Beacon.prototype.emit = emitBeaconValue;
|
|
17
16
|
Beacon.prototype.error = emitBeaconError;
|
|
@@ -33,10 +32,10 @@ Object.defineProperties(Beacon.prototype, {
|
|
|
33
32
|
function Observable(beacon) {
|
|
34
33
|
this[BEACON_SYMBOL] = {
|
|
35
34
|
beacon,
|
|
36
|
-
active: beacon.active
|
|
35
|
+
active: beacon.active,
|
|
36
|
+
name: BEACON_OBSERVABLE
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
Observable.prototype[BEACON_PROPERTY] = BEACON_OBSERVABLE;
|
|
40
39
|
Observable.prototype.deactivate = deactivateObservable;
|
|
41
40
|
Observable.prototype.subscribe = subscribeToObservable;
|
|
42
41
|
Object.defineProperty(Observable.prototype, "active", {
|
|
@@ -127,16 +126,7 @@ function isBeacon(value) {
|
|
|
127
126
|
return isBeaconInstance(BEACON_NAME, value);
|
|
128
127
|
}
|
|
129
128
|
function isBeaconInstance(name, value) {
|
|
130
|
-
return typeof value === "object" && value !== null &&
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Is the value a beacon subscription?
|
|
134
|
-
*
|
|
135
|
-
* @param value Value to check
|
|
136
|
-
* @returns `true` if the value is a beacon subscription, otherwise `false`
|
|
137
|
-
*/
|
|
138
|
-
function isBeaconSubscription(value) {
|
|
139
|
-
return isSubscription(value) && value["$beacon"] === "subscription";
|
|
129
|
+
return typeof value === "object" && value !== null && BEACON_SYMBOL in value && value[BEACON_SYMBOL].name === name;
|
|
140
130
|
}
|
|
141
131
|
/**
|
|
142
132
|
* Is the value an observable?
|
|
@@ -150,7 +140,7 @@ function isObservable(value) {
|
|
|
150
140
|
function subscribeToObservable(first, second, third) {
|
|
151
141
|
const state = this[BEACON_SYMBOL];
|
|
152
142
|
if (!state.beacon.active || !state.active) throw new Error(BEACON_MESSAGE_SUBSCRIBE);
|
|
153
|
-
state.beacon.subscriptions ??= subscriptions(
|
|
143
|
+
state.beacon.subscriptions ??= subscriptions();
|
|
154
144
|
const observer = createObserver(first, second, third);
|
|
155
145
|
const [subscription] = state.beacon.subscriptions.create({
|
|
156
146
|
isActive: () => state.beacon.active && state.active,
|
|
@@ -170,4 +160,4 @@ function updateBeacon(instance, type, value, finish) {
|
|
|
170
160
|
if (subscriptions != null && subscriptions.size > 0) for (const [, observer] of subscriptions) observer[type]?.(value);
|
|
171
161
|
if (finish === true) closeBeacon(state, true);
|
|
172
162
|
}
|
|
173
|
-
export { beacon, isBeacon,
|
|
163
|
+
export { beacon, isBeacon, isObservable };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SubscriptionProperty } from "../models/subscription.model.mjs";
|
|
2
1
|
import { ColorDefaults, ColorExpressions, ColorTypeExtended, HSLAColor, HSLColor, HWBAColor, HWBColor, RGBAColor, RGBColor } from "../models/color.model.mjs";
|
|
3
2
|
type ColorTypes = {
|
|
4
3
|
all: Set<"alpha" | ColorTypeExtended>;
|
|
@@ -38,9 +37,7 @@ export declare const COLOR_MAX: {
|
|
|
38
37
|
hex: number;
|
|
39
38
|
percent: number;
|
|
40
39
|
};
|
|
41
|
-
export declare const
|
|
42
|
-
export declare const COLOR_PROPERTY = "$color";
|
|
43
|
-
export declare const COLOR_SYMBOL: symbol;
|
|
40
|
+
export declare const COLOR_SYMBOL: unique symbol;
|
|
44
41
|
export declare const COLOR_TYPE: ColorTypes;
|
|
45
42
|
export declare const COLOR_SRGB: {
|
|
46
43
|
luminanceBlue: number;
|
|
@@ -53,5 +50,4 @@ export declare const COLOR_SRGB: {
|
|
|
53
50
|
luminanceRed: number;
|
|
54
51
|
luminanceThreshold: number;
|
|
55
52
|
};
|
|
56
|
-
export declare const colorSubscription: SubscriptionProperty;
|
|
57
53
|
export {};
|
package/dist/color/constants.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SUBSCRIPTION_NAME } from "../models/subscription.model.mjs";
|
|
2
1
|
// src/color/constants.ts
|
|
3
2
|
const COLOR_ALPHA = {
|
|
4
3
|
fullHexShort: "f",
|
|
@@ -68,9 +67,7 @@ const COLOR_MAX = {
|
|
|
68
67
|
hex: 255,
|
|
69
68
|
percent: 100
|
|
70
69
|
};
|
|
71
|
-
const
|
|
72
|
-
const COLOR_PROPERTY = "$color";
|
|
73
|
-
const COLOR_SYMBOL = Symbol(COLOR_PROPERTY);
|
|
70
|
+
const COLOR_SYMBOL = Symbol("color");
|
|
74
71
|
const COLOR_TYPE = {
|
|
75
72
|
all: void 0,
|
|
76
73
|
hex: "hex",
|
|
@@ -105,8 +102,4 @@ const COLOR_SRGB = {
|
|
|
105
102
|
luminanceRed: .2126,
|
|
106
103
|
luminanceThreshold: .625
|
|
107
104
|
};
|
|
108
|
-
|
|
109
|
-
key: COLOR_PROPERTY,
|
|
110
|
-
value: SUBSCRIPTION_NAME
|
|
111
|
-
};
|
|
112
|
-
export { COLOR_ALPHA, COLOR_DEFAULTS, COLOR_EXPRESSION, COLOR_KEYS, COLOR_LENGTHS, COLOR_MAX, COLOR_NAME, COLOR_PROPERTY, COLOR_SRGB, COLOR_SYMBOL, COLOR_TYPE, colorSubscription };
|
|
105
|
+
export { COLOR_ALPHA, COLOR_DEFAULTS, COLOR_EXPRESSION, COLOR_KEYS, COLOR_LENGTHS, COLOR_MAX, COLOR_SRGB, COLOR_SYMBOL, COLOR_TYPE };
|
package/dist/color/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { color } from "./instance.mjs";
|
|
2
2
|
import { isColor, isHexColor, isHslColor, isHslaColor, isHwbColor, isHwbaColor, isRgbColor, isRgbaColor } from "./misc/is.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { getForegroundColor, getHexColor, getHexaColor, getHslColor, getHslaColor, getHwbColor, getHwbaColor, getRgbColor, getRgbaColor } from "./misc/get.mjs";
|
|
4
4
|
import { getNormalizedHex, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, hexToRgba } from "./space/hex.mjs";
|
|
5
5
|
import { hslToHex, hslToHwb, hslToHwba, hslToRgb, hslToRgba } from "./space/hsl.mjs";
|
|
6
6
|
import { hwbToHex, hwbToHsl, hwbToHsla, hwbToRgb, hwbToRgba } from "./space/hwb.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba } from "./space/rgb.mjs";
|
|
8
8
|
// src/color/index.ts
|
|
9
9
|
/**
|
|
10
10
|
* Get a _Color_ from any kind of value
|
package/dist/color/instance.mjs
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { herald } from "../internal/herald.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { COLOR_SYMBOL, COLOR_TYPE } from "./constants.mjs";
|
|
3
3
|
import { getColorAlpha, setColorAlpha } from "./misc/alpha.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { formatHexColor, formatHslColor, formatHwbColor, formatRgbColor } from "./misc/format.mjs";
|
|
5
|
+
import { getColorState } from "./misc/state.mjs";
|
|
5
6
|
import { getHexColor, getHexaColor, setHexValue, setHexaValue } from "./space/hex.mjs";
|
|
6
7
|
import { getHslValue, getHslaValue, setHslValue, setHslaValue } from "./space/hsl.mjs";
|
|
7
8
|
import { getHwbValue, getHwbaValue, setHwbValue, setHwbaValue } from "./space/hwb.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { formatHexColor, formatHslColor, formatHwbColor, formatRgbColor } from "./misc/format.mjs";
|
|
9
|
+
import { getRgbColor, getRgbaColor, setRgbValue, setRgbaValue } from "./space/rgb.mjs";
|
|
10
10
|
// src/color/instance.ts
|
|
11
11
|
function Color(value) {
|
|
12
12
|
this[COLOR_SYMBOL] = {
|
|
13
13
|
changes: herald({
|
|
14
14
|
names: [COLOR_TYPE.wildcard, ...COLOR_TYPE.all],
|
|
15
|
-
property: colorSubscription,
|
|
16
15
|
onCreate: (event, callback) => onCreateSubscription(this, event, callback)
|
|
17
16
|
}),
|
|
18
17
|
values: getColorState(value)
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
Color.prototype[COLOR_PROPERTY] = COLOR_NAME;
|
|
22
20
|
Color.prototype.subscribe = subscribeToColor;
|
|
23
21
|
Color.prototype.toHexString = formatHexColor;
|
|
24
22
|
Color.prototype.toHslString = formatHslColor;
|
package/dist/color/misc/get.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { round } from "../../internal/math/misc.mjs";
|
|
2
2
|
import { clamp } from "../../internal/number.mjs";
|
|
3
3
|
import { COLOR_DEFAULTS, COLOR_MAX, COLOR_SRGB, COLOR_TYPE } from "../constants.mjs";
|
|
4
|
-
import { getColorFromState, getColorState } from "./state.mjs";
|
|
5
4
|
import { color } from "../instance.mjs";
|
|
5
|
+
import { getColorFromState, getColorState } from "./state.mjs";
|
|
6
6
|
// src/color/misc/get.ts
|
|
7
7
|
function getClampedValue(value, minimum, maximum, rounding) {
|
|
8
8
|
if (typeof value !== "number" || Number.isNaN(value)) return minimum;
|
package/dist/color/misc/is.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Subscription } from "../../models/subscription.model.mjs";
|
|
2
1
|
import { Color, HSLAColor, HSLColor, HWBAColor, HWBColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
|
|
3
2
|
/**
|
|
4
3
|
* Is the value a _Color_?
|
|
@@ -7,13 +6,6 @@ import { Color, HSLAColor, HSLColor, HWBAColor, HWBColor, RGBAColor, RGBColor }
|
|
|
7
6
|
* @returns `true` if the value is a _Color_, otherwise `false`
|
|
8
7
|
*/
|
|
9
8
|
export declare function isColor(value: unknown): value is Color;
|
|
10
|
-
/**
|
|
11
|
-
* Is the value a color subscription?
|
|
12
|
-
*
|
|
13
|
-
* @param value Value to check
|
|
14
|
-
* @returns `true` if the value is a color subscription, otherwise `false`
|
|
15
|
-
*/
|
|
16
|
-
export declare function isColorSubscription(value: unknown): value is Subscription;
|
|
17
9
|
/**
|
|
18
10
|
* Is the value a hex color?
|
|
19
11
|
*
|
package/dist/color/misc/is.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import "../../models/subscription.model.mjs";
|
|
2
|
-
import { isSubscription } from "../../internal/subscription.mjs";
|
|
3
1
|
import { between } from "../../internal/number.mjs";
|
|
4
|
-
import { COLOR_ALPHA, COLOR_EXPRESSION, COLOR_KEYS, COLOR_LENGTHS, COLOR_MAX } from "../constants.mjs";
|
|
2
|
+
import { COLOR_ALPHA, COLOR_EXPRESSION, COLOR_KEYS, COLOR_LENGTHS, COLOR_MAX, COLOR_SYMBOL } from "../constants.mjs";
|
|
5
3
|
// src/color/misc/is.ts
|
|
6
4
|
function hasKeys(value, keys) {
|
|
7
5
|
return typeof value === "object" && value !== null && keys.every((key) => key in value);
|
|
@@ -19,16 +17,7 @@ function isBytey(value) {
|
|
|
19
17
|
* @returns `true` if the value is a _Color_, otherwise `false`
|
|
20
18
|
*/
|
|
21
19
|
function isColor(value) {
|
|
22
|
-
return typeof value === "object" && value !== null &&
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Is the value a color subscription?
|
|
26
|
-
*
|
|
27
|
-
* @param value Value to check
|
|
28
|
-
* @returns `true` if the value is a color subscription, otherwise `false`
|
|
29
|
-
*/
|
|
30
|
-
function isColorSubscription(value) {
|
|
31
|
-
return isSubscription(value) && "$color" in value && value["$color"] === "subscription";
|
|
20
|
+
return typeof value === "object" && value !== null && COLOR_SYMBOL in value;
|
|
32
21
|
}
|
|
33
22
|
function isColorValue(value, properties) {
|
|
34
23
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -156,4 +145,4 @@ const validators = {
|
|
|
156
145
|
red: isBytey,
|
|
157
146
|
whiteness: isPercentage
|
|
158
147
|
};
|
|
159
|
-
export { isColor,
|
|
148
|
+
export { isColor, isHexColor, isHslColor, isHslLike, isHslaColor, isHslaLike, isHwbColor, isHwbLike, isHwbaColor, isHwbaLike, isRgbColor, isRgbLike, isRgbaColor, isRgbaLike };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { COLOR_DEFAULTS, COLOR_KEYS, COLOR_LENGTHS, COLOR_MAX, COLOR_SYMBOL, COLOR_TYPE } from "../constants.mjs";
|
|
2
|
-
import { getAlpha } from "./alpha.mjs";
|
|
3
|
-
import { isColor } from "./is.mjs";
|
|
4
|
-
import { getColorFromRgb, getRgbValues } from "../space/rgb.mjs";
|
|
5
2
|
import { getColorFromHex, getNormalizedHex } from "../space/hex.mjs";
|
|
6
3
|
import { getColorFromHsl, getHslValues } from "../space/hsl.mjs";
|
|
7
4
|
import { getColorFromHwb, getHwbValues } from "../space/hwb.mjs";
|
|
5
|
+
import { getColorFromRgb, getRgbValues } from "../space/rgb.mjs";
|
|
6
|
+
import { getAlpha } from "./alpha.mjs";
|
|
7
|
+
import { isColor } from "./is.mjs";
|
|
8
8
|
// src/color/misc/state.ts
|
|
9
9
|
function getColorFromState(state, type) {
|
|
10
10
|
const { origin } = state;
|
package/dist/color/space/hex.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { join } from "../../internal/string/misc.mjs";
|
|
|
2
2
|
import { COLOR_ALPHA, COLOR_DEFAULTS, COLOR_EXPRESSION, COLOR_LENGTHS, COLOR_MAX, COLOR_SYMBOL, COLOR_TYPE } from "../constants.mjs";
|
|
3
3
|
import { getHexValue, getPercentage } from "../misc/get.mjs";
|
|
4
4
|
import { isHexColor } from "../misc/is.mjs";
|
|
5
|
-
import { convertRgbToHsla, convertRgbToHwba } from "./rgb.mjs";
|
|
6
5
|
import { getStateValue, setStateValue } from "../misc/state.mjs";
|
|
6
|
+
import { convertRgbToHsla, convertRgbToHwba } from "./rgb.mjs";
|
|
7
7
|
// src/color/space/hex.ts
|
|
8
8
|
function convertHexToRgba(value) {
|
|
9
9
|
const normalized = getNormalizedHex(value, true);
|
package/dist/color/space/hsl.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import { COLOR_DEFAULTS, COLOR_MAX, COLOR_TYPE } from "../constants.mjs";
|
|
|
3
3
|
import { getAlphaValue } from "../misc/alpha.mjs";
|
|
4
4
|
import { getDegrees, getHexValue, getPercentage } from "../misc/get.mjs";
|
|
5
5
|
import { isHslLike } from "../misc/is.mjs";
|
|
6
|
-
import { convertRgbToHex } from "./rgb.mjs";
|
|
7
6
|
import { getStateValue, setStateValue } from "../misc/state.mjs";
|
|
7
|
+
import { convertRgbToHex } from "./rgb.mjs";
|
|
8
8
|
// src/color/space/hsl.ts
|
|
9
9
|
function convertHslToHwba(input) {
|
|
10
10
|
let { hue, lightness, saturation } = isHslLike(input) ? getHslValues(input) : { ...COLOR_DEFAULTS.hsl };
|
package/dist/color/space/hwb.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import { COLOR_DEFAULTS, COLOR_MAX, COLOR_TYPE } from "../constants.mjs";
|
|
|
3
3
|
import { getAlphaValue } from "../misc/alpha.mjs";
|
|
4
4
|
import { getDegrees, getPercentage } from "../misc/get.mjs";
|
|
5
5
|
import { isHwbLike } from "../misc/is.mjs";
|
|
6
|
-
import { rgbToHex } from "./rgb.mjs";
|
|
7
|
-
import { hslToRgb, hslToRgba } from "./hsl.mjs";
|
|
8
6
|
import { getStateValue, setStateValue } from "../misc/state.mjs";
|
|
7
|
+
import { hslToRgb, hslToRgba } from "./hsl.mjs";
|
|
8
|
+
import { rgbToHex } from "./rgb.mjs";
|
|
9
9
|
// src/color/space/hwb.ts
|
|
10
10
|
function convertHwbToHsl(input) {
|
|
11
11
|
let { blackness, hue, whiteness } = isHwbLike(input) ? getHwbValues(input) : COLOR_DEFAULTS.hwb;
|