@oscarpalmer/atoms 0.220.0 → 0.222.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.d.mts +1 -3
- package/dist/array/difference.mjs +1 -2
- package/dist/array/exists.d.mts +1 -3
- package/dist/array/exists.mjs +1 -2
- package/dist/array/filter.d.mts +1 -3
- package/dist/array/filter.mjs +1 -2
- package/dist/array/find.d.mts +1 -3
- package/dist/array/find.mjs +1 -2
- package/dist/array/first.d.mts +1 -3
- package/dist/array/first.mjs +1 -2
- package/dist/array/flatten.d.mts +1 -3
- package/dist/array/flatten.mjs +1 -2
- package/dist/array/from.d.mts +1 -3
- package/dist/array/from.mjs +1 -2
- package/dist/array/group-by.d.mts +1 -3
- package/dist/array/group-by.mjs +1 -2
- package/dist/array/insert.d.mts +1 -3
- package/dist/array/insert.mjs +1 -2
- package/dist/array/intersection.d.mts +1 -3
- package/dist/array/intersection.mjs +1 -2
- package/dist/array/last.d.mts +1 -3
- package/dist/array/last.mjs +1 -2
- package/dist/array/move.d.mts +1 -3
- package/dist/array/move.mjs +1 -2
- package/dist/array/partition.d.mts +1 -3
- package/dist/array/partition.mjs +1 -2
- package/dist/array/push.d.mts +0 -2
- package/dist/array/push.mjs +1 -2
- package/dist/array/reverse.d.mts +1 -3
- package/dist/array/reverse.mjs +1 -2
- package/dist/array/select.d.mts +0 -2
- package/dist/array/select.mjs +1 -2
- package/dist/array/single.d.mts +1 -3
- package/dist/array/single.mjs +1 -2
- package/dist/array/slice.d.mts +1 -3
- package/dist/array/slice.mjs +1 -2
- package/dist/array/sort.d.mts +0 -2
- package/dist/array/sort.mjs +1 -2
- package/dist/array/splice.d.mts +1 -3
- package/dist/array/splice.mjs +1 -2
- package/dist/array/swap.d.mts +0 -2
- package/dist/array/swap.mjs +1 -2
- package/dist/array/to-map.d.mts +1 -3
- package/dist/array/to-map.mjs +1 -2
- package/dist/array/to-record.d.mts +1 -3
- package/dist/array/to-record.mjs +1 -2
- package/dist/array/to-set.d.mts +1 -3
- package/dist/array/to-set.mjs +1 -2
- package/dist/array/toggle.d.mts +1 -3
- package/dist/array/toggle.mjs +1 -2
- package/dist/array/union.d.mts +1 -3
- package/dist/array/union.mjs +1 -2
- package/dist/array/unique.d.mts +1 -3
- package/dist/array/unique.mjs +1 -2
- package/dist/array/update.d.mts +1 -3
- package/dist/array/update.mjs +1 -2
- package/dist/beacon.d.mts +0 -2
- package/dist/beacon.mjs +2 -3
- package/dist/color/constants.d.mts +0 -2
- package/dist/color/constants.mjs +1 -2
- package/dist/color/index.d.mts +0 -2
- package/dist/color/index.mjs +1 -2
- package/dist/color/instance.d.mts +1 -3
- package/dist/color/instance.mjs +1 -2
- package/dist/color/misc/alpha.d.mts +1 -3
- package/dist/color/misc/alpha.mjs +1 -2
- package/dist/color/misc/format.d.mts +1 -3
- package/dist/color/misc/format.mjs +1 -2
- package/dist/color/misc/get.d.mts +1 -3
- package/dist/color/misc/get.mjs +1 -2
- package/dist/color/misc/is.d.mts +1 -3
- package/dist/color/misc/is.mjs +1 -2
- package/dist/color/misc/state.d.mts +1 -3
- package/dist/color/misc/state.mjs +1 -2
- package/dist/color/space/hex.d.mts +1 -3
- package/dist/color/space/hex.mjs +1 -2
- package/dist/color/space/hsl.d.mts +1 -3
- package/dist/color/space/hsl.mjs +1 -2
- package/dist/color/space/hwb.d.mts +1 -3
- package/dist/color/space/hwb.mjs +1 -2
- package/dist/color/space/rgb.d.mts +1 -3
- package/dist/color/space/rgb.mjs +1 -2
- package/dist/function/limit.d.mts +0 -2
- package/dist/function/limit.mjs +1 -2
- package/dist/function/once.d.mts +0 -2
- package/dist/function/once.mjs +1 -2
- package/dist/function/retry.d.mts +0 -2
- package/dist/function/retry.mjs +1 -2
- package/dist/index.d.mts +8 -266
- package/dist/index.mjs +211 -370
- package/dist/internal/aborter.d.mts +1 -3
- package/dist/internal/aborter.mjs +1 -2
- package/dist/internal/array/callbacks.d.mts +1 -3
- package/dist/internal/array/callbacks.mjs +1 -2
- package/dist/internal/array/chunk.d.mts +1 -3
- package/dist/internal/array/chunk.mjs +1 -2
- package/dist/internal/array/compact.d.mts +1 -3
- package/dist/internal/array/compact.mjs +1 -2
- package/dist/internal/array/find.d.mts +1 -3
- package/dist/internal/array/find.mjs +1 -2
- package/dist/internal/array/get.d.mts +1 -3
- package/dist/internal/array/get.mjs +1 -2
- package/dist/internal/array/group.d.mts +1 -3
- package/dist/internal/array/group.mjs +1 -2
- package/dist/internal/array/index-of.d.mts +1 -3
- package/dist/internal/array/index-of.mjs +1 -2
- package/dist/internal/array/insert.d.mts +1 -3
- package/dist/internal/array/insert.mjs +1 -2
- package/dist/internal/array/match.d.mts +1 -3
- package/dist/internal/array/match.mjs +1 -2
- package/dist/internal/array/overlap.d.mts +1 -3
- package/dist/internal/array/overlap.mjs +1 -2
- package/dist/internal/array/sets.d.mts +1 -3
- package/dist/internal/array/sets.mjs +1 -2
- package/dist/internal/array/shuffle.d.mts +1 -3
- package/dist/internal/array/shuffle.mjs +1 -2
- package/dist/internal/array/update.d.mts +1 -3
- package/dist/internal/array/update.mjs +1 -2
- package/dist/internal/defaults.d.mts +1 -3
- package/dist/internal/defaults.mjs +1 -2
- package/dist/internal/function/assert.d.mts +0 -2
- package/dist/internal/function/assert.mjs +2 -5
- package/dist/internal/function/limit.d.mts +1 -3
- package/dist/internal/function/limit.mjs +1 -2
- package/dist/internal/function/memoize.d.mts +0 -2
- package/dist/internal/function/memoize.mjs +1 -2
- package/dist/internal/function/misc.d.mts +1 -2
- package/dist/internal/function/misc.mjs +7 -3
- package/dist/internal/function/work.d.mts +0 -2
- package/dist/internal/function/work.mjs +5 -13
- package/dist/internal/herald.d.mts +1 -3
- package/dist/internal/herald.mjs +1 -2
- package/dist/internal/is.d.mts +1 -3
- package/dist/internal/is.mjs +1 -2
- package/dist/internal/math/aggregate.d.mts +1 -3
- package/dist/internal/math/aggregate.mjs +1 -2
- package/dist/internal/math/misc.d.mts +1 -3
- package/dist/internal/math/misc.mjs +1 -2
- package/dist/internal/number.d.mts +1 -3
- package/dist/internal/number.mjs +1 -2
- package/dist/internal/plan/index.d.mts +1 -3
- package/dist/internal/plan/index.mjs +1 -2
- package/dist/internal/plan/plan.generate.d.mts +1 -3
- package/dist/internal/plan/plan.generate.mjs +2 -3
- package/dist/internal/random.d.mts +1 -3
- package/dist/internal/random.mjs +1 -2
- package/dist/internal/result/attempt.d.mts +1 -3
- package/dist/internal/result/attempt.mjs +1 -2
- package/dist/internal/result/misc.d.mts +1 -3
- package/dist/internal/result/misc.mjs +1 -2
- package/dist/internal/sized/map.d.mts +1 -3
- package/dist/internal/sized/map.mjs +1 -2
- package/dist/internal/sized/misc.d.mts +1 -3
- package/dist/internal/sized/misc.mjs +1 -2
- package/dist/internal/string/case.d.mts +3 -3
- package/dist/internal/string/case.mjs +37 -31
- package/dist/internal/string/misc.d.mts +1 -3
- package/dist/internal/string/misc.mjs +2 -3
- package/dist/internal/subscription.d.mts +1 -3
- package/dist/internal/subscription.mjs +3 -8
- package/dist/internal/value/compare.d.mts +1 -3
- package/dist/internal/value/compare.mjs +1 -2
- package/dist/internal/value/equal.d.mts +0 -2
- package/dist/internal/value/equal.mjs +1 -2
- package/dist/internal/value/get.d.mts +1 -3
- package/dist/internal/value/get.mjs +1 -2
- package/dist/internal/value/handlers.d.mts +1 -3
- package/dist/internal/value/handlers.mjs +1 -2
- package/dist/internal/value/has.d.mts +1 -3
- package/dist/internal/value/has.mjs +1 -2
- package/dist/internal/value/misc.d.mts +1 -3
- package/dist/internal/value/misc.mjs +2 -3
- package/dist/internal/value/partial.d.mts +1 -3
- package/dist/internal/value/partial.mjs +1 -2
- package/dist/internal/value/set.d.mts +1 -3
- package/dist/internal/value/set.mjs +1 -2
- package/dist/is.d.mts +0 -2
- package/dist/is.mjs +1 -2
- package/dist/logger.d.mts +0 -2
- package/dist/logger.mjs +1 -2
- package/dist/math.d.mts +0 -2
- package/dist/math.mjs +1 -2
- package/dist/models/aborter.model.d.mts +1 -3
- package/dist/models/aborter.model.mjs +1 -2
- package/dist/models/array/array.find.model.d.mts +1 -3
- package/dist/models/array/array.find.model.mjs +1 -2
- package/dist/models/array/array.match.model.d.mts +1 -3
- package/dist/models/array/array.match.model.mjs +1 -2
- package/dist/models/array/array.misc.model.d.mts +1 -3
- package/dist/models/array/array.misc.model.mjs +1 -2
- package/dist/models/array/array.sort.model.d.mts +1 -3
- package/dist/models/array/array.sort.model.mjs +1 -2
- package/dist/models/beacon.model.d.mts +1 -3
- package/dist/models/beacon.model.mjs +1 -2
- package/dist/models/color.model.d.mts +0 -2
- package/dist/models/function/assert.model.d.mts +1 -3
- package/dist/models/function/assert.model.mjs +1 -2
- package/dist/models/function/limiter.model.d.mts +1 -3
- package/dist/models/function/limiter.model.mjs +1 -2
- package/dist/models/function/memoize.model.d.mts +1 -3
- package/dist/models/function/memoize.model.mjs +1 -2
- package/dist/models/function/once.model.d.mts +0 -2
- package/dist/models/function/once.model.mjs +1 -2
- package/dist/models/function/retry.model.d.mts +1 -3
- package/dist/models/function/retry.model.mjs +1 -2
- package/dist/models/function/work.model.d.mts +1 -3
- package/dist/models/function/work.model.mjs +1 -2
- package/dist/models/herald.model.d.mts +1 -3
- package/dist/models/herald.model.mjs +1 -2
- package/dist/models/index.d.mts +0 -2
- package/dist/models/logger.model.d.mts +1 -3
- package/dist/models/logger.model.mjs +1 -2
- package/dist/models/math.model.d.mts +1 -3
- package/dist/models/math.model.mjs +1 -2
- package/dist/models/misc.model.d.mts +1 -3
- package/dist/models/misc.model.mjs +1 -2
- package/dist/models/plan.model.d.mts +0 -2
- package/dist/models/plan.model.mjs +1 -2
- package/dist/models/promise.model.d.mts +1 -3
- package/dist/models/promise.model.mjs +1 -2
- package/dist/models/query.model.d.mts +1 -3
- package/dist/models/query.model.mjs +1 -2
- package/dist/models/queue.model.d.mts +0 -2
- package/dist/models/queue.model.mjs +1 -2
- package/dist/models/random.model.d.mts +1 -3
- package/dist/models/random.model.mjs +1 -2
- package/dist/models/result.model.d.mts +0 -2
- package/dist/models/string/string.case.model.d.mts +8 -5
- package/dist/models/string/string.case.model.mjs +10 -6
- package/dist/models/string/string.fuzzy.model.d.mts +0 -2
- package/dist/models/string/string.fuzzy.model.mjs +1 -2
- package/dist/models/string/string.misc.model.d.mts +1 -3
- package/dist/models/string/string.misc.model.mjs +2 -3
- package/dist/models/string/string.normalize.model.d.mts +1 -3
- package/dist/models/string/string.normalize.model.mjs +1 -2
- package/dist/models/string/string.template.model.d.mts +1 -3
- package/dist/models/string/string.template.model.mjs +2 -3
- package/dist/models/subscription.model.d.mts +1 -3
- package/dist/models/subscription.model.mjs +1 -2
- package/dist/models/value/value.clone.model.d.mts +1 -3
- package/dist/models/value/value.clone.model.mjs +1 -2
- package/dist/models/value/value.diff.model.d.mts +1 -3
- package/dist/models/value/value.diff.model.mjs +1 -2
- package/dist/models/value/value.equal.model.d.mts +0 -2
- package/dist/models/value/value.equal.model.mjs +1 -2
- package/dist/models/value/value.handler.model.d.mts +1 -3
- package/dist/models/value/value.merge.model.d.mts +0 -2
- package/dist/models/value/value.merge.model.mjs +1 -2
- package/dist/models/value/value.misc.model.d.mts +0 -2
- package/dist/models/value/value.misc.model.mjs +1 -2
- package/dist/models/value/value.transform.model.d.mts +1 -3
- package/dist/models/value/value.transform.model.mjs +1 -2
- package/dist/plan/index.d.mts +1 -3
- package/dist/plan/index.mjs +1 -2
- package/dist/plan/is.d.mts +1 -3
- package/dist/plan/is.mjs +1 -2
- package/dist/plan/misc.d.mts +1 -3
- package/dist/plan/misc.mjs +1 -2
- package/dist/plan/result.d.mts +1 -3
- package/dist/plan/result.mjs +1 -2
- package/dist/plan/run.d.mts +1 -3
- package/dist/plan/run.mjs +1 -2
- package/dist/plan/use.d.mts +1 -3
- package/dist/plan/use.mjs +1 -2
- package/dist/promise/delay.d.mts +1 -3
- package/dist/promise/delay.mjs +1 -2
- package/dist/promise/helpers.d.mts +1 -3
- package/dist/promise/helpers.mjs +1 -2
- package/dist/promise/index.d.mts +0 -2
- package/dist/promise/index.mjs +1 -2
- package/dist/promise/misc.d.mts +0 -2
- package/dist/promise/misc.mjs +1 -2
- package/dist/promise/timed.d.mts +1 -3
- package/dist/promise/timed.mjs +1 -2
- package/dist/query.d.mts +1 -3
- package/dist/query.mjs +1 -2
- package/dist/queue.d.mts +0 -2
- package/dist/queue.mjs +1 -2
- package/dist/random.d.mts +0 -2
- package/dist/random.mjs +1 -2
- package/dist/result/match.d.mts +1 -3
- package/dist/result/match.mjs +1 -2
- package/dist/result/misc.d.mts +0 -2
- package/dist/result/misc.mjs +1 -2
- package/dist/result/work/flow.d.mts +1 -3
- package/dist/result/work/flow.mjs +4 -11
- package/dist/result/work/pipe.d.mts +0 -2
- package/dist/result/work/pipe.mjs +1 -2
- package/dist/sized/set.d.mts +1 -3
- package/dist/sized/set.mjs +1 -2
- package/dist/string/fuzzy.d.mts +0 -2
- package/dist/string/fuzzy.mjs +1 -2
- package/dist/string/index.d.mts +0 -2
- package/dist/string/index.mjs +1 -2
- package/dist/string/match.d.mts +1 -3
- package/dist/string/match.mjs +1 -2
- package/dist/string/normalize.d.mts +0 -2
- package/dist/string/normalize.mjs +1 -2
- package/dist/string/template.d.mts +0 -2
- package/dist/string/template.mjs +1 -2
- package/dist/value/clone.d.mts +0 -2
- package/dist/value/clone.mjs +1 -2
- package/dist/value/collection.d.mts +1 -3
- package/dist/value/collection.mjs +1 -2
- package/dist/value/diff.d.mts +0 -2
- package/dist/value/diff.mjs +1 -2
- package/dist/value/freeze.d.mts +1 -3
- package/dist/value/freeze.mjs +2 -3
- package/dist/value/merge.d.mts +0 -2
- package/dist/value/merge.mjs +1 -2
- package/dist/value/omit.d.mts +1 -3
- package/dist/value/omit.mjs +1 -2
- package/dist/value/pick.d.mts +1 -3
- package/dist/value/pick.mjs +1 -2
- package/dist/value/shake.d.mts +0 -2
- package/dist/value/shake.mjs +1 -2
- package/dist/value/smush.d.mts +0 -2
- package/dist/value/smush.mjs +1 -2
- package/dist/value/transform.d.mts +0 -2
- package/dist/value/transform.mjs +1 -2
- package/dist/value/unsmush.d.mts +0 -2
- package/dist/value/unsmush.mjs +1 -2
- package/package.json +2 -2
package/dist/array/toggle.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
|
-
//#region src/array/toggle.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Toggle an item in an array
|
|
5
4
|
*
|
|
@@ -57,5 +56,4 @@ export declare function toggle<Item extends PlainObject, ItemKey extends keyof I
|
|
|
57
56
|
* ); // => [1, 3, 4]
|
|
58
57
|
* ```
|
|
59
58
|
*/
|
|
60
|
-
export declare function toggle<Item>(destination: Item[], toggled: Item[]): Item[];
|
|
61
|
-
//#endregion
|
|
59
|
+
export declare function toggle<Item>(destination: Item[], toggled: Item[]): Item[];
|
package/dist/array/toggle.mjs
CHANGED
package/dist/array/union.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/array/union.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Get the combined, unique values from two arrays
|
|
4
3
|
*
|
|
@@ -50,5 +49,4 @@ export declare function union<First extends Record<string, unknown>, Second exte
|
|
|
50
49
|
* ); // => [1, 2, 3, 4]
|
|
51
50
|
* ```
|
|
52
51
|
*/
|
|
53
|
-
export declare function union<First, Second>(first: First[], second: Second[]): (First | Second)[];
|
|
54
|
-
//#endregion
|
|
52
|
+
export declare function union<First, Second>(first: First[], second: Second[]): (First | Second)[];
|
package/dist/array/union.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ARRAY_SETS_COMPARE_UNION } from "../models/array/array.misc.model.mjs";
|
|
2
2
|
import { compareSets } from "../internal/array/sets.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);
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { union };
|
package/dist/array/unique.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
|
-
//#region src/array/unique.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Get an array of unique items
|
|
5
4
|
*
|
|
@@ -43,5 +42,4 @@ export declare function unique<Item extends PlainObject, ItemKey extends keyof I
|
|
|
43
42
|
* unique([1, 2, 3, 2]); // => [1, 2, 3]
|
|
44
43
|
* ```
|
|
45
44
|
*/
|
|
46
|
-
export declare function unique<Item>(array: Item[]): Item[];
|
|
47
|
-
//#endregion
|
|
45
|
+
export declare function unique<Item>(array: Item[]): Item[];
|
package/dist/array/unique.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ARRAY_FIND_VALUES_UNIQUE } from "../models/array/array.find.model.mjs";
|
|
2
2
|
import { findValues } from "../internal/array/find.mjs";
|
|
3
|
-
|
|
3
|
+
// src/array/unique.ts
|
|
4
4
|
function unique(array, key) {
|
|
5
5
|
if (!Array.isArray(array)) return [];
|
|
6
6
|
return array.length > 1 ? findValues(ARRAY_FIND_VALUES_UNIQUE, array, [key, void 0]).matched : array;
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { unique };
|
package/dist/array/update.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
|
-
//#region src/array/update.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Update an item in an array
|
|
5
4
|
*
|
|
@@ -57,5 +56,4 @@ export declare function update<Item extends PlainObject, ItemKey extends keyof I
|
|
|
57
56
|
* ); // => [1, 2, 3, 4]
|
|
58
57
|
* ```
|
|
59
58
|
*/
|
|
60
|
-
export declare function update<Item>(destination: Item[], updated: Item[]): Item[];
|
|
61
|
-
//#endregion
|
|
59
|
+
export declare function update<Item>(destination: Item[], updated: Item[]): Item[];
|
package/dist/array/update.mjs
CHANGED
package/dist/beacon.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Subscription } from "./models/subscription.model.mjs";
|
|
2
2
|
import { Beacon, BeaconOptions, BeaconState, Observable, Observer } from "./models/beacon.model.mjs";
|
|
3
|
-
//#region src/beacon.d.ts
|
|
4
3
|
declare function Beacon(this: any, value: unknown, options?: BeaconOptions<unknown>): void;
|
|
5
4
|
declare function Observable(this: any, beacon: BeaconState<unknown>): void;
|
|
6
5
|
/**
|
|
@@ -32,5 +31,4 @@ export declare function isBeaconSubscription(value: unknown): value is Subscript
|
|
|
32
31
|
* @returns `true` if the value is an observable, otherwise `false`
|
|
33
32
|
*/
|
|
34
33
|
export declare function isObservable<Value = unknown>(value: unknown): value is Observable<Value>;
|
|
35
|
-
//#endregion
|
|
36
34
|
export type { Beacon, BeaconOptions, Observable, Observer };
|
package/dist/beacon.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { noop } from "./internal/function/misc.mjs";
|
|
2
1
|
import { isPlainObject } from "./internal/is.mjs";
|
|
2
|
+
import { noop } from "./internal/function/misc.mjs";
|
|
3
3
|
import "./models/subscription.model.mjs";
|
|
4
4
|
import { isSubscription, subscriptions } from "./internal/subscription.mjs";
|
|
5
5
|
import { BEACON_MESSAGE_RETRIEVE, BEACON_MESSAGE_SUBSCRIBE, BEACON_NAME, BEACON_OBSERVABLE, BEACON_PROPERTY, BEACON_SYMBOL, BEACON_TYPE_ERROR, BEACON_TYPE_NEXT, beaconSubscription } from "./models/beacon.model.mjs";
|
|
6
|
-
|
|
6
|
+
// src/beacon.ts
|
|
7
7
|
function Beacon(value, options) {
|
|
8
8
|
this[BEACON_SYMBOL] = {
|
|
9
9
|
value,
|
|
@@ -170,5 +170,4 @@ function updateBeacon(instance, type, value, finish) {
|
|
|
170
170
|
if (subscriptions != null && subscriptions.size > 0) for (const [, observer] of subscriptions) observer[type]?.(value);
|
|
171
171
|
if (finish === true) closeBeacon(state, true);
|
|
172
172
|
}
|
|
173
|
-
//#endregion
|
|
174
173
|
export { beacon, isBeacon, isBeaconSubscription, isObservable };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SubscriptionProperty } from "../models/subscription.model.mjs";
|
|
2
2
|
import { ColorDefaults, ColorExpressions, ColorTypeExtended, HSLAColor, HSLColor, HWBAColor, HWBColor, RGBAColor, RGBColor } from "../models/color.model.mjs";
|
|
3
|
-
//#region src/color/constants.d.ts
|
|
4
3
|
type ColorTypes = {
|
|
5
4
|
all: Set<"alpha" | ColorTypeExtended>;
|
|
6
5
|
hex: "hex";
|
|
@@ -55,5 +54,4 @@ export declare const COLOR_SRGB: {
|
|
|
55
54
|
luminanceThreshold: number;
|
|
56
55
|
};
|
|
57
56
|
export declare const colorSubscription: SubscriptionProperty;
|
|
58
|
-
//#endregion
|
|
59
57
|
export {};
|
package/dist/color/constants.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SUBSCRIPTION_NAME } from "../models/subscription.model.mjs";
|
|
2
|
-
|
|
2
|
+
// src/color/constants.ts
|
|
3
3
|
const COLOR_ALPHA = {
|
|
4
4
|
fullHexShort: "f",
|
|
5
5
|
fullHexLong: "ff",
|
|
@@ -109,5 +109,4 @@ const colorSubscription = {
|
|
|
109
109
|
key: COLOR_PROPERTY,
|
|
110
110
|
value: SUBSCRIPTION_NAME
|
|
111
111
|
};
|
|
112
|
-
//#endregion
|
|
113
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 };
|
package/dist/color/index.d.mts
CHANGED
|
@@ -5,7 +5,6 @@ import { getNormalizedHex, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, h
|
|
|
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
7
|
import { rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba } from "./space/rgb.mjs";
|
|
8
|
-
//#region src/color/index.d.ts
|
|
9
8
|
/**
|
|
10
9
|
* Get a _Color_ from any kind of value
|
|
11
10
|
*
|
|
@@ -16,5 +15,4 @@ import { rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba } from "./space/rgb.
|
|
|
16
15
|
* @returns _Color_ instance
|
|
17
16
|
*/
|
|
18
17
|
export declare function getColor(value: unknown): Color;
|
|
19
|
-
//#endregion
|
|
20
18
|
export { type Color, type ColorType, type ColorTypeExtended, type ColorValue, type ColorValueExtended, type HSLAColor, type HSLColor, type HWBAColor, type HWBColor, type RGBAColor, type RGBColor, getForegroundColor, getHexColor, getHexaColor, getHslColor, getHslaColor, getHwbColor, getHwbaColor, getNormalizedHex, getRgbColor, getRgbaColor, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, hexToRgba, hslToHex, hslToHwb, hslToHwba, hslToRgb, hslToRgba, hwbToHex, hwbToHsl, hwbToHsla, hwbToRgb, hwbToRgba, isColor, isHexColor, isHslColor, isHslaColor, isHwbColor, isHwbaColor, isRgbColor, isRgbaColor, rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba };
|
package/dist/color/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { getNormalizedHex, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, h
|
|
|
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
7
|
import { color } from "./instance.mjs";
|
|
8
|
-
|
|
8
|
+
// src/color/index.ts
|
|
9
9
|
/**
|
|
10
10
|
* Get a _Color_ from any kind of value
|
|
11
11
|
*
|
|
@@ -18,5 +18,4 @@ import { color } from "./instance.mjs";
|
|
|
18
18
|
function getColor(value) {
|
|
19
19
|
return isColor(value) ? value : color(value);
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { getColor, getForegroundColor, getHexColor, getHexaColor, getHslColor, getHslaColor, getHwbColor, getHwbaColor, getNormalizedHex, getRgbColor, getRgbaColor, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, hexToRgba, hslToHex, hslToHwb, hslToHwba, hslToRgb, hslToRgba, hwbToHex, hwbToHsl, hwbToHsla, hwbToRgb, hwbToRgba, isColor, isHexColor, isHslColor, isHslaColor, isHwbColor, isHwbaColor, isRgbColor, isRgbaColor, rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba };
|
package/dist/color/instance.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { getHslValue, getHslaValue, setHslValue, setHslaValue } from "./space/hs
|
|
|
7
7
|
import { getHwbValue, getHwbaValue, setHwbValue, setHwbaValue } from "./space/hwb.mjs";
|
|
8
8
|
import { getColorState } from "./misc/state.mjs";
|
|
9
9
|
import { formatHexColor, formatHslColor, formatHwbColor, formatRgbColor } from "./misc/format.mjs";
|
|
10
|
-
|
|
10
|
+
// src/color/instance.ts
|
|
11
11
|
function Color(value) {
|
|
12
12
|
this[COLOR_SYMBOL] = {
|
|
13
13
|
changes: herald({
|
|
@@ -103,5 +103,4 @@ function subscribeToColor(callback, signal) {
|
|
|
103
103
|
function unsubscribeFromColor() {
|
|
104
104
|
this[COLOR_SYMBOL].changes.clear();
|
|
105
105
|
}
|
|
106
|
-
//#endregion
|
|
107
106
|
export { color };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Alpha, InternalColor } from "../../models/color.model.mjs";
|
|
2
|
-
//#region src/color/misc/alpha.d.ts
|
|
3
2
|
export declare function getAlpha(value: unknown, hex: boolean): Alpha;
|
|
4
3
|
export declare function getColorAlpha(this: InternalColor): number;
|
|
5
4
|
export declare function getAlphaHexadecimal(value: number): string;
|
|
6
5
|
export declare function getAlphaValue(original: number): number;
|
|
7
|
-
export declare function setColorAlpha(this: InternalColor, value: unknown): void;
|
|
8
|
-
//#endregion
|
|
6
|
+
export declare function setColorAlpha(this: InternalColor, value: unknown): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { round } from "../../internal/math/misc.mjs";
|
|
2
2
|
import { clamp } from "../../internal/number.mjs";
|
|
3
3
|
import { COLOR_ALPHA, COLOR_DEFAULTS, COLOR_EXPRESSION, COLOR_MAX, COLOR_SYMBOL } from "../constants.mjs";
|
|
4
|
-
|
|
4
|
+
// src/color/misc/alpha.ts
|
|
5
5
|
function getAlpha(value, hex) {
|
|
6
6
|
if (typeof value === "number") return getAlphaFromValue(value);
|
|
7
7
|
if (typeof value !== "string" || value.toLowerCase() === COLOR_ALPHA.fullHexLong) return { ...COLOR_DEFAULTS.alpha };
|
|
@@ -33,5 +33,4 @@ function getAlphaValue(original) {
|
|
|
33
33
|
function setColorAlpha(value) {
|
|
34
34
|
if (typeof value === "number" && !Number.isNaN(value)) this[COLOR_SYMBOL].values.alpha = getAlpha(value, false);
|
|
35
35
|
}
|
|
36
|
-
//#endregion
|
|
37
36
|
export { getAlpha, getAlphaHexadecimal, getAlphaValue, getColorAlpha, setColorAlpha };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { InternalColor } from "../../models/color.model.mjs";
|
|
2
|
-
//#region src/color/misc/format.d.ts
|
|
3
2
|
export declare function formatHexColor(this: InternalColor, alpha?: boolean): string;
|
|
4
3
|
export declare function formatHslColor(this: InternalColor, alpha?: boolean): string;
|
|
5
4
|
export declare function formatHwbColor(this: InternalColor, alpha?: boolean): string;
|
|
6
|
-
export declare function formatRgbColor(this: InternalColor, alpha?: boolean): string;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare function formatRgbColor(this: InternalColor, alpha?: boolean): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { COLOR_SYMBOL, COLOR_TYPE } from "../constants.mjs";
|
|
2
2
|
import { getColorFromState } from "./state.mjs";
|
|
3
|
-
|
|
3
|
+
// src/color/misc/format.ts
|
|
4
4
|
function formatHexColor(alpha) {
|
|
5
5
|
return `#${alpha === true ? this.hexa : this.hex}`;
|
|
6
6
|
}
|
|
@@ -22,5 +22,4 @@ function formatRgbColor(alpha) {
|
|
|
22
22
|
function getSuffix(state, alpha) {
|
|
23
23
|
return alpha === true ? ` / ${state.alpha.value}%` : "";
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { formatHexColor, formatHslColor, formatHwbColor, formatRgbColor };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Color, HSLAColor, HSLColor, HWBAColor, HWBColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
|
|
2
|
-
//#region src/color/misc/get.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Get a foreground color _(usually text)_ based on a background color's luminance as an unprefixed hex color string
|
|
5
4
|
*
|
|
@@ -102,5 +101,4 @@ export declare function getRgbaColor(value: unknown): RGBAColor;
|
|
|
102
101
|
* @param value Original value
|
|
103
102
|
* @returns _RGB_ color
|
|
104
103
|
*/
|
|
105
|
-
export declare function getRgbColor(value: unknown): RGBColor;
|
|
106
|
-
//#endregion
|
|
104
|
+
export declare function getRgbColor(value: unknown): RGBColor;
|
package/dist/color/misc/get.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { clamp } from "../../internal/number.mjs";
|
|
|
3
3
|
import { COLOR_DEFAULTS, COLOR_MAX, COLOR_SRGB, COLOR_TYPE } from "../constants.mjs";
|
|
4
4
|
import { getColorFromState, getColorState } from "./state.mjs";
|
|
5
5
|
import { color } from "../instance.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;
|
|
9
9
|
const actual = rounding ?? false ? round(value) : value;
|
|
@@ -143,5 +143,4 @@ function getRgbaColor(value) {
|
|
|
143
143
|
function getRgbColor(value) {
|
|
144
144
|
return getColorFromState(getColorState(value), COLOR_TYPE.rgb);
|
|
145
145
|
}
|
|
146
|
-
//#endregion
|
|
147
146
|
export { getDegrees, getForegroundColor, getHexColor, getHexValue, getHexaColor, getHslColor, getHslaColor, getHwbColor, getHwbaColor, getPercentage, getRgbColor, getRgbaColor };
|
package/dist/color/misc/is.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Subscription } from "../../models/subscription.model.mjs";
|
|
2
2
|
import { Color, HSLAColor, HSLColor, HWBAColor, HWBColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
|
|
3
|
-
//#region src/color/misc/is.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Is the value a _Color_?
|
|
6
5
|
*
|
|
@@ -79,5 +78,4 @@ export declare function isRgbaLike(value: unknown): value is Record<keyof RGBACo
|
|
|
79
78
|
* @returns `true` if the value is an _RGB_ color, otherwise `false`
|
|
80
79
|
*/
|
|
81
80
|
export declare function isRgbColor(value: unknown): value is RGBColor;
|
|
82
|
-
export declare function isRgbLike(value: unknown): value is Record<keyof RGBColor, unknown>;
|
|
83
|
-
//#endregion
|
|
81
|
+
export declare function isRgbLike(value: unknown): value is Record<keyof RGBColor, unknown>;
|
package/dist/color/misc/is.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import "../../models/subscription.model.mjs";
|
|
|
2
2
|
import { isSubscription } from "../../internal/subscription.mjs";
|
|
3
3
|
import { between } from "../../internal/number.mjs";
|
|
4
4
|
import { COLOR_ALPHA, COLOR_EXPRESSION, COLOR_KEYS, COLOR_LENGTHS, COLOR_MAX } from "../constants.mjs";
|
|
5
|
-
|
|
5
|
+
// src/color/misc/is.ts
|
|
6
6
|
function hasKeys(value, keys) {
|
|
7
7
|
return typeof value === "object" && value !== null && keys.every((key) => key in value);
|
|
8
8
|
}
|
|
@@ -156,5 +156,4 @@ const validators = {
|
|
|
156
156
|
red: isBytey,
|
|
157
157
|
whiteness: isPercentage
|
|
158
158
|
};
|
|
159
|
-
//#endregion
|
|
160
159
|
export { isColor, isColorSubscription, isHexColor, isHslColor, isHslLike, isHslaColor, isHslaLike, isHwbColor, isHwbLike, isHwbaColor, isHwbaLike, isRgbColor, isRgbLike, isRgbaColor, isRgbaLike };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
|
|
2
|
-
//#region src/color/misc/state.d.ts
|
|
3
2
|
export declare function getColorFromState<Type extends ColorType>(state: ColorState, type: Type): NonNullable<ColorState[Type]>;
|
|
4
3
|
export declare function getColorState(value: unknown): ColorState;
|
|
5
4
|
export declare function getStateValue(instance: InternalColor, type: ColorType, alpha: boolean): string | HSLAColor | HSLColor | HWBAColor | HWBColor | RGBAColor | RGBColor;
|
|
6
|
-
export declare function setStateValue<Type extends ColorType>(instance: InternalColor, type: Type, value: ColorState[Type], alpha?: number | string): void;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare function setStateValue<Type extends ColorType>(instance: InternalColor, type: Type, value: ColorState[Type], alpha?: number | string): void;
|
|
@@ -5,7 +5,7 @@ import { getColorFromRgb, getRgbValues } from "../space/rgb.mjs";
|
|
|
5
5
|
import { getColorFromHex, getNormalizedHex } from "../space/hex.mjs";
|
|
6
6
|
import { getColorFromHsl, getHslValues } from "../space/hsl.mjs";
|
|
7
7
|
import { getColorFromHwb, getHwbValues } from "../space/hwb.mjs";
|
|
8
|
-
|
|
8
|
+
// src/color/misc/state.ts
|
|
9
9
|
function getColorFromState(state, type) {
|
|
10
10
|
const { origin } = state;
|
|
11
11
|
if (type === origin) return state[origin];
|
|
@@ -85,5 +85,4 @@ const getters = {
|
|
|
85
85
|
hwb: getColorFromHwb,
|
|
86
86
|
rgb: getColorFromRgb
|
|
87
87
|
};
|
|
88
|
-
//#endregion
|
|
89
88
|
export { getColorFromState, getColorState, getStateValue, setStateValue };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
|
|
2
|
-
//#region src/color/space/hex.d.ts
|
|
3
2
|
export declare function getColorFromHex<Type extends ColorType>(state: ColorState, type: Type): NonNullable<ColorState[Type]>;
|
|
4
3
|
export declare function getHexColor(this: InternalColor): string;
|
|
5
4
|
export declare function getHexaColor(this: InternalColor): string;
|
|
@@ -76,5 +75,4 @@ export declare function hexToRgb(value: string): RGBColor;
|
|
|
76
75
|
*/
|
|
77
76
|
export declare function hexToRgba(value: string): RGBAColor;
|
|
78
77
|
export declare function setHexValue(this: InternalColor, value: string): void;
|
|
79
|
-
export declare function setHexaValue(this: InternalColor, value: string): void;
|
|
80
|
-
//#endregion
|
|
78
|
+
export declare function setHexaValue(this: InternalColor, value: string): void;
|
package/dist/color/space/hex.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { getHexValue, getPercentage } from "../misc/get.mjs";
|
|
|
4
4
|
import { isHexColor } from "../misc/is.mjs";
|
|
5
5
|
import { convertRgbToHsla, convertRgbToHwba } from "./rgb.mjs";
|
|
6
6
|
import { getStateValue, setStateValue } from "../misc/state.mjs";
|
|
7
|
-
|
|
7
|
+
// src/color/space/hex.ts
|
|
8
8
|
function convertHexToRgba(value) {
|
|
9
9
|
const normalized = getNormalizedHex(value, true);
|
|
10
10
|
const pairs = COLOR_EXPRESSION.hexLong.exec(normalized);
|
|
@@ -157,5 +157,4 @@ function setHexValueInState(instance, value, alpha) {
|
|
|
157
157
|
function setHexaValue(value) {
|
|
158
158
|
setHexValueInState(this, value, true);
|
|
159
159
|
}
|
|
160
|
-
//#endregion
|
|
161
160
|
export { getColorFromHex, getHexColor, getHexaColor, getNormalizedHex, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, hexToRgba, setHexValue, setHexaValue };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
|
|
2
|
-
//#region src/color/space/hsl.d.ts
|
|
3
2
|
export declare function getColorFromHsl<Type extends ColorType>(state: ColorState, type: Type): NonNullable<ColorState[Type]>;
|
|
4
3
|
export declare function getHslValue(this: InternalColor): HSLColor;
|
|
5
4
|
export declare function getHslaValue(this: InternalColor): HSLAColor;
|
|
@@ -55,5 +54,4 @@ export declare function hslToRgb(hsl: HSLAColor | HSLColor): RGBColor;
|
|
|
55
54
|
*/
|
|
56
55
|
export declare function hslToRgba(hsl: HSLAColor | HSLColor): RGBAColor;
|
|
57
56
|
export declare function setHslValue(this: InternalColor, value: unknown): void;
|
|
58
|
-
export declare function setHslaValue(this: InternalColor, value: unknown): void;
|
|
59
|
-
//#endregion
|
|
57
|
+
export declare function setHslaValue(this: InternalColor, value: unknown): void;
|
package/dist/color/space/hsl.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { getDegrees, getHexValue, getPercentage } from "../misc/get.mjs";
|
|
|
5
5
|
import { isHslLike } from "../misc/is.mjs";
|
|
6
6
|
import { convertRgbToHex } from "./rgb.mjs";
|
|
7
7
|
import { getStateValue, setStateValue } from "../misc/state.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 };
|
|
11
11
|
lightness /= COLOR_MAX.percent;
|
|
@@ -150,5 +150,4 @@ function setHSLValueInState(instance, value, alpha) {
|
|
|
150
150
|
function setHslaValue(value) {
|
|
151
151
|
setHSLValueInState(this, value, true);
|
|
152
152
|
}
|
|
153
|
-
//#endregion
|
|
154
153
|
export { getColorFromHsl, getHslValue, getHslValues, getHslaValue, hslToHex, hslToHwb, hslToHwba, hslToRgb, hslToRgba, setHslValue, setHslaValue };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
|
|
2
|
-
//#region src/color/space/hwb.d.ts
|
|
3
2
|
export declare function convertHwbToHsl(input: HWBAColor | HWBColor): HSLAColor;
|
|
4
3
|
export declare function getColorFromHwb<Type extends ColorType>(state: ColorState, type: Type): NonNullable<ColorState[Type]>;
|
|
5
4
|
export declare function getHwbValue(this: InternalColor): HWBColor;
|
|
@@ -52,5 +51,4 @@ export declare function hwbToRgb(hwb: HWBAColor | HWBColor): RGBColor;
|
|
|
52
51
|
*/
|
|
53
52
|
export declare function hwbToRgba(hwb: HWBAColor | HWBColor): RGBAColor;
|
|
54
53
|
export declare function setHwbValue(this: InternalColor, value: unknown): void;
|
|
55
|
-
export declare function setHwbaValue(this: InternalColor, value: unknown): void;
|
|
56
|
-
//#endregion
|
|
54
|
+
export declare function setHwbaValue(this: InternalColor, value: unknown): void;
|
package/dist/color/space/hwb.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { isHwbLike } from "../misc/is.mjs";
|
|
|
6
6
|
import { rgbToHex } from "./rgb.mjs";
|
|
7
7
|
import { hslToRgb, hslToRgba } from "./hsl.mjs";
|
|
8
8
|
import { getStateValue, setStateValue } from "../misc/state.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;
|
|
12
12
|
blackness /= COLOR_MAX.percent;
|
|
@@ -129,5 +129,4 @@ function setHwbColorValueInState(instance, value, alpha) {
|
|
|
129
129
|
function setHwbaValue(value) {
|
|
130
130
|
setHwbColorValueInState(this, value, true);
|
|
131
131
|
}
|
|
132
|
-
//#endregion
|
|
133
132
|
export { convertHwbToHsl, getColorFromHwb, getHwbValue, getHwbValues, getHwbaValue, hwbToHex, hwbToHsl, hwbToHsla, hwbToRgb, hwbToRgba, setHwbValue, setHwbaValue };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
|
|
2
|
-
//#region src/color/space/rgb.d.ts
|
|
3
2
|
export declare function convertRgbToHex(rgb: RGBAColor | RGBColor, alpha: boolean): string;
|
|
4
3
|
export declare function convertRgbToHsla(value: unknown): HSLAColor;
|
|
5
4
|
export declare function convertRgbToHwba(value: unknown): HWBAColor;
|
|
@@ -62,5 +61,4 @@ export declare function rgbToHwb(rgb: RGBAColor | RGBColor): HWBColor;
|
|
|
62
61
|
*/
|
|
63
62
|
export declare function rgbToHwba(rgb: RGBAColor | RGBColor): HWBAColor;
|
|
64
63
|
export declare function setRgbValue(this: InternalColor, value: unknown): void;
|
|
65
|
-
export declare function setRgbaValue(this: InternalColor, value: unknown): void;
|
|
66
|
-
//#endregion
|
|
64
|
+
export declare function setRgbaValue(this: InternalColor, value: unknown): void;
|
package/dist/color/space/rgb.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { getAlpha, getAlphaValue } from "../misc/alpha.mjs";
|
|
|
5
5
|
import { getHexValue } from "../misc/get.mjs";
|
|
6
6
|
import { isRgbLike } from "../misc/is.mjs";
|
|
7
7
|
import { getStateValue, setStateValue } from "../misc/state.mjs";
|
|
8
|
-
|
|
8
|
+
// src/color/space/rgb.ts
|
|
9
9
|
function convertRgbToHex(rgb, alpha) {
|
|
10
10
|
const hex = `${join([
|
|
11
11
|
rgb.red,
|
|
@@ -196,5 +196,4 @@ function setRgbColorValueInState(instance, value, alpha) {
|
|
|
196
196
|
function setRgbaValue(value) {
|
|
197
197
|
setRgbColorValueInState(this, value, true);
|
|
198
198
|
}
|
|
199
|
-
//#endregion
|
|
200
199
|
export { convertRgbToHex, convertRgbToHsla, convertRgbToHwba, getColorFromRgb, getRgbColor, getRgbValues, getRgbaColor, rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba, setRgbValue, setRgbaValue };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenericAsyncCallback, GenericCallback } from "../models/index.mjs";
|
|
2
2
|
import { AsyncLimiter, Limiter } from "../models/function/limiter.model.mjs";
|
|
3
|
-
//#region src/function/limit.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Debounce a function, ensuring it is only called after `time` milliseconds have passed
|
|
6
5
|
*
|
|
@@ -51,5 +50,4 @@ export declare namespace debounce {
|
|
|
51
50
|
export declare namespace throttle {
|
|
52
51
|
export var async: typeof asyncThrottle;
|
|
53
52
|
}
|
|
54
|
-
//#endregion
|
|
55
53
|
export type { AsyncLimiter, Limiter };
|
package/dist/function/limit.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LIMITER_DEBOUNCE, LIMITER_THROTTLE } from "../models/function/limiter.model.mjs";
|
|
2
2
|
import { getAsyncLimiter, getLimiter } from "../internal/function/limit.mjs";
|
|
3
|
-
|
|
3
|
+
// src/function/limit.ts
|
|
4
4
|
/**
|
|
5
5
|
* Debounce a function, ensuring it is only called after `time` milliseconds have passed
|
|
6
6
|
*
|
|
@@ -55,5 +55,4 @@ function throttle(callback, time) {
|
|
|
55
55
|
}
|
|
56
56
|
debounce.async = asyncDebounce;
|
|
57
57
|
throttle.async = asyncThrottle;
|
|
58
|
-
//#endregion
|
|
59
58
|
export { asyncDebounce, asyncThrottle, debounce, throttle };
|
package/dist/function/once.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenericAsyncCallback, GenericCallback } from "../models/index.mjs";
|
|
2
2
|
import { AsyncOnce, Once } from "../models/function/once.model.mjs";
|
|
3
|
-
//#region src/function/once.d.ts
|
|
4
3
|
declare function AsyncOnce(this: any, callback: GenericAsyncCallback): void;
|
|
5
4
|
declare function Once(this: any, callback: GenericCallback): void;
|
|
6
5
|
/**
|
|
@@ -41,5 +40,4 @@ export declare namespace once {
|
|
|
41
40
|
export var is: typeof isOnce;
|
|
42
41
|
export var isAsync: typeof isAsyncOnce;
|
|
43
42
|
}
|
|
44
|
-
//#endregion
|
|
45
43
|
export type { AsyncOnce, Once };
|
package/dist/function/once.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assert } from "../internal/function/assert.mjs";
|
|
2
2
|
import { ONCE_MESSAGE_CLEARED, ONCE_MESSAGE_EXPECTATION, ONCE_NAME_ASYNC, ONCE_NAME_SYNC, ONCE_PROPERTY, ONCE_SYMBOL } from "../models/function/once.model.mjs";
|
|
3
|
-
|
|
3
|
+
// src/function/once.ts
|
|
4
4
|
function AsyncOnce(callback) {
|
|
5
5
|
this[ONCE_SYMBOL] = {
|
|
6
6
|
callback,
|
|
@@ -163,5 +163,4 @@ asyncOnce.is = isAsyncOnce;
|
|
|
163
163
|
once.async = asyncOnce;
|
|
164
164
|
once.is = isOnce;
|
|
165
165
|
once.isAsync = isAsyncOnce;
|
|
166
|
-
//#endregion
|
|
167
166
|
export { asyncOnce, isAsyncOnce, isOnce, once };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenericAsyncCallback, GenericCallback } from "../models/index.mjs";
|
|
2
2
|
import { RetryError, RetryOptions } from "../models/function/retry.model.mjs";
|
|
3
|
-
//#region src/function/retry.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Retry a callback a specified number of times, with a delay between attempts
|
|
6
5
|
*
|
|
@@ -32,5 +31,4 @@ export declare function retry<Callback extends GenericCallback>(callback: Callba
|
|
|
32
31
|
export declare namespace retry {
|
|
33
32
|
export var async: typeof asyncRetry;
|
|
34
33
|
}
|
|
35
|
-
//#endregion
|
|
36
34
|
export { RetryError };
|
package/dist/function/retry.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { LIMITER_WAIT } from "../models/function/limiter.model.mjs";
|
|
|
4
4
|
import { getNumberOrDefault } from "../internal/defaults.mjs";
|
|
5
5
|
import { getLimiter } from "../internal/function/limit.mjs";
|
|
6
6
|
import { RETRY_MESSAGE_EXPECTATION, RETRY_MESSAGE_FAILED, RetryError } from "../models/function/retry.model.mjs";
|
|
7
|
-
|
|
7
|
+
// src/function/retry.ts
|
|
8
8
|
/**
|
|
9
9
|
* Retry a callback a specified number of times, with a delay between attempts
|
|
10
10
|
*
|
|
@@ -72,5 +72,4 @@ function shouldRetry() {
|
|
|
72
72
|
return true;
|
|
73
73
|
}
|
|
74
74
|
retry.async = asyncRetry;
|
|
75
|
-
//#endregion
|
|
76
75
|
export { RetryError, retry };
|