@oscarpalmer/atoms 0.221.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.d.mts +1 -3
- package/dist/array/difference.mjs +2 -3
- package/dist/array/exists.d.mts +1 -3
- package/dist/array/exists.mjs +11 -6
- package/dist/array/filter.d.mts +1 -3
- package/dist/array/filter.mjs +15 -6
- package/dist/array/find.d.mts +1 -3
- package/dist/array/find.mjs +9 -5
- package/dist/array/first.d.mts +1 -3
- package/dist/array/first.mjs +10 -5
- 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/index.d.mts +4 -4
- package/dist/array/insert.d.mts +1 -3
- package/dist/array/insert.mjs +2 -3
- package/dist/array/intersection.d.mts +1 -3
- package/dist/array/intersection.mjs +2 -3
- package/dist/array/last.d.mts +1 -3
- package/dist/array/last.mjs +12 -5
- 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 +24 -5
- package/dist/array/push.d.mts +0 -2
- package/dist/array/push.mjs +2 -3
- 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 +40 -9
- package/dist/array/single.d.mts +1 -3
- package/dist/array/single.mjs +9 -7
- 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 +2 -3
- package/dist/array/splice.d.mts +1 -3
- package/dist/array/splice.mjs +2 -3
- package/dist/array/swap.d.mts +0 -2
- package/dist/array/swap.mjs +2 -3
- 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 +2 -3
- package/dist/array/unique.d.mts +1 -3
- package/dist/array/unique.mjs +18 -5
- package/dist/array/update.d.mts +1 -3
- package/dist/array/update.mjs +1 -2
- package/dist/beacon.d.mts +3 -13
- package/dist/beacon.mjs +10 -21
- package/dist/color/constants.d.mts +1 -7
- package/dist/color/constants.mjs +3 -11
- package/dist/color/index.d.mts +0 -2
- package/dist/color/index.mjs +4 -5
- package/dist/color/instance.d.mts +1 -3
- package/dist/color/instance.mjs +5 -8
- 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 +2 -3
- package/dist/color/misc/is.d.mts +1 -11
- package/dist/color/misc/is.mjs +4 -16
- package/dist/color/misc/state.d.mts +1 -3
- package/dist/color/misc/state.mjs +4 -5
- package/dist/color/space/hex.d.mts +1 -3
- package/dist/color/space/hex.mjs +2 -3
- package/dist/color/space/hsl.d.mts +1 -3
- package/dist/color/space/hsl.mjs +2 -3
- package/dist/color/space/hwb.d.mts +1 -3
- package/dist/color/space/hwb.mjs +3 -4
- package/dist/color/space/rgb.d.mts +1 -3
- package/dist/color/space/rgb.mjs +1 -2
- package/dist/function/limit.d.mts +1 -3
- package/dist/function/limit.mjs +2 -3
- package/dist/function/once.d.mts +1 -3
- package/dist/function/once.mjs +8 -9
- package/dist/function/retry.d.mts +1 -3
- package/dist/function/retry.mjs +11 -12
- package/dist/herald.d.mts +2 -2
- package/dist/herald.mjs +1 -1
- package/dist/index.d.mts +81 -359
- package/dist/index.mjs +514 -661
- package/dist/internal/aborter.d.mts +1 -3
- package/dist/internal/aborter.mjs +1 -2
- package/dist/internal/array/callbacks.d.mts +2 -4
- 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 +2 -8
- package/dist/internal/array/find.mjs +31 -124
- 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 +10 -5
- package/dist/internal/array/insert.d.mts +1 -3
- package/dist/internal/array/insert.mjs +2 -3
- package/dist/internal/array/match.d.mts +2 -4
- package/dist/internal/array/match.mjs +2 -3
- 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 +5 -6
- 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 +1 -3
- package/dist/internal/function/assert.mjs +1 -2
- package/dist/internal/function/limit.d.mts +2 -4
- package/dist/internal/function/limit.mjs +8 -9
- package/dist/internal/function/memoize.d.mts +1 -3
- package/dist/internal/function/memoize.mjs +4 -5
- package/dist/internal/function/misc.d.mts +1 -2
- package/dist/internal/function/misc.mjs +7 -3
- package/dist/internal/function/work.d.mts +1 -3
- package/dist/internal/function/work.mjs +5 -13
- package/dist/internal/herald.d.mts +2 -12
- package/dist/internal/herald.mjs +9 -33
- 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 +2 -3
- 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 +2 -3
- package/dist/internal/plan/index.d.mts +1 -3
- package/dist/internal/plan/index.mjs +2 -3
- package/dist/internal/plan/plan.generate.d.mts +1 -3
- package/dist/internal/plan/plan.generate.mjs +67 -22
- 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 +4 -3
- package/dist/internal/sized/map.mjs +4 -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 +1 -3
- package/dist/internal/string/case.mjs +3 -4
- package/dist/internal/string/misc.d.mts +1 -3
- package/dist/internal/string/misc.mjs +1 -2
- package/dist/internal/subscription.d.mts +1 -3
- package/dist/internal/subscription.mjs +16 -29
- package/dist/internal/value/compare.d.mts +1 -3
- package/dist/internal/value/compare.mjs +2 -3
- package/dist/internal/value/equal.d.mts +1 -3
- package/dist/internal/value/equal.mjs +3 -4
- 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 +2 -3
- package/dist/is.d.mts +0 -2
- package/dist/is.mjs +2 -3
- package/dist/logger.d.mts +0 -2
- package/dist/logger.mjs +7 -7
- package/dist/math.d.mts +0 -2
- package/dist/math.mjs +2 -3
- package/dist/models/aborter.model.d.mts +1 -3
- package/dist/models/aborter.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 +11 -2
- package/dist/models/array/array.misc.model.mjs +3 -3
- 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 +4 -6
- package/dist/models/beacon.model.mjs +3 -10
- package/dist/models/color.model.d.mts +2 -4
- 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 +2 -4
- package/dist/models/function/limiter.model.mjs +2 -4
- package/dist/models/function/memoize.model.d.mts +2 -4
- package/dist/models/function/memoize.model.mjs +1 -2
- package/dist/models/function/once.model.d.mts +0 -3
- package/dist/models/function/once.model.mjs +3 -5
- 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 +2 -4
- package/dist/models/function/work.model.mjs +1 -2
- package/dist/models/herald.model.d.mts +8 -7
- package/dist/models/herald.model.mjs +3 -10
- package/dist/models/index.d.mts +0 -2
- package/dist/models/logger.model.d.mts +1 -4
- package/dist/models/logger.model.mjs +3 -5
- 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 +35 -37
- package/dist/models/plan.model.mjs +1 -2
- package/dist/models/promise.model.d.mts +8 -10
- package/dist/models/promise.model.mjs +4 -5
- 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 -3
- package/dist/models/queue.model.mjs +3 -5
- 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 +1 -3
- package/dist/models/string/string.case.model.mjs +1 -2
- package/dist/models/string/string.fuzzy.model.d.mts +0 -3
- package/dist/models/string/string.fuzzy.model.mjs +3 -5
- package/dist/models/string/string.misc.model.d.mts +1 -3
- package/dist/models/string/string.misc.model.mjs +1 -2
- 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 +1 -2
- package/dist/models/subscription.model.d.mts +4 -23
- package/dist/models/subscription.model.mjs +3 -5
- 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 +2 -3
- 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 +2 -3
- package/dist/plan/models.d.mts +2 -2
- package/dist/plan/result.d.mts +8 -10
- package/dist/plan/result.mjs +2 -3
- package/dist/plan/run.d.mts +8 -10
- package/dist/plan/run.mjs +2 -3
- package/dist/plan/use.d.mts +1 -3
- package/dist/plan/use.mjs +14 -9
- package/dist/promise/delay.d.mts +1 -3
- package/dist/promise/delay.mjs +2 -3
- package/dist/promise/helpers.d.mts +1 -3
- package/dist/promise/helpers.mjs +2 -3
- package/dist/promise/index.d.mts +0 -2
- package/dist/promise/index.mjs +5 -6
- package/dist/promise/misc.d.mts +1 -3
- package/dist/promise/misc.mjs +2 -3
- package/dist/promise/models.d.mts +2 -2
- package/dist/promise/models.mjs +1 -1
- package/dist/promise/timed.d.mts +1 -3
- package/dist/promise/timed.mjs +4 -5
- package/dist/query.d.mts +1 -3
- package/dist/query.mjs +2 -3
- package/dist/queue.d.mts +0 -2
- package/dist/queue.mjs +11 -12
- package/dist/random.d.mts +0 -2
- package/dist/random.mjs +2 -3
- 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 +5 -12
- package/dist/result/work/pipe.d.mts +0 -2
- package/dist/result/work/pipe.mjs +2 -3
- package/dist/sized/set.d.mts +4 -3
- package/dist/sized/set.mjs +4 -2
- package/dist/string/fuzzy.d.mts +0 -2
- package/dist/string/fuzzy.mjs +5 -7
- package/dist/string/index.d.mts +0 -2
- package/dist/string/index.mjs +2 -3
- package/dist/string/match.d.mts +1 -3
- package/dist/string/match.mjs +2 -3
- package/dist/string/normalize.d.mts +0 -2
- package/dist/string/normalize.mjs +3 -4
- package/dist/string/template.d.mts +0 -2
- package/dist/string/template.mjs +1 -2
- package/dist/subscription.d.mts +2 -2
- package/dist/value/clone.d.mts +1 -3
- package/dist/value/clone.mjs +2 -3
- 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 +1 -2
- package/dist/value/handle.mjs +1 -1
- 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 +2 -3
- 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 +6 -6
- package/dist/models/array/array.find.model.d.mts +0 -48
- package/dist/models/array/array.find.model.mjs +0 -8
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
//#region src/models/query.model.d.ts
|
|
2
1
|
export declare const QUERY_AMPERSAND = "&";
|
|
3
2
|
export declare const QUERY_DOT = ".";
|
|
4
3
|
export declare const QUERY_EQUAL = "=";
|
|
5
4
|
export declare const QUERY_EXPRESSION_ARRAY_SUFFIX: RegExp;
|
|
6
5
|
export declare const QUERY_EXPRESSION_BOOLEAN: RegExp;
|
|
7
6
|
export declare const QUERY_TRUE = "true";
|
|
8
|
-
export declare const QUERY_TYPES: Set<string>;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare const QUERY_TYPES: Set<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/query.model.ts
|
|
2
2
|
const QUERY_AMPERSAND = "&";
|
|
3
3
|
const QUERY_DOT = ".";
|
|
4
4
|
const QUERY_EQUAL = "=";
|
|
@@ -10,5 +10,4 @@ const QUERY_TYPES = /* @__PURE__ */ new Set([
|
|
|
10
10
|
"number",
|
|
11
11
|
"string"
|
|
12
12
|
]);
|
|
13
|
-
//#endregion
|
|
14
13
|
export { QUERY_AMPERSAND, QUERY_DOT, QUERY_EQUAL, QUERY_EXPRESSION_ARRAY_SUFFIX, QUERY_EXPRESSION_BOOLEAN, QUERY_TRUE, QUERY_TYPES };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenericAsyncCallback, GenericCallback } from "./index.mjs";
|
|
2
2
|
import { Aborter } from "./aborter.model.mjs";
|
|
3
|
-
//#region src/models/queue.model.d.ts
|
|
4
3
|
export type InternalKeyedQueue = {
|
|
5
4
|
[QUEUE_SYMBOL]: KeyedQueueState;
|
|
6
5
|
} & KeyedQueue<GenericAsyncCallback, unknown[]>;
|
|
@@ -242,11 +241,9 @@ export declare const QUEUE_MESSAGE_MAXIMUM = "Queue has reached its maximum size
|
|
|
242
241
|
export declare const QUEUE_MESSAGE_REMOVE = "Item removed from queue";
|
|
243
242
|
export declare const QUEUE_NAME_KEYED = "keyedQueue";
|
|
244
243
|
export declare const QUEUE_NAME_QUEUE = "queue";
|
|
245
|
-
export declare const QUEUE_PROPERTY = "$queue";
|
|
246
244
|
export declare const QUEUE_STATUS_ACTIVE: QueueStatusKey;
|
|
247
245
|
export declare const QUEUE_STATUS_EMPTY: QueueStatusKey;
|
|
248
246
|
export declare const QUEUE_STATUS_FULL: QueueStatusKey;
|
|
249
247
|
export declare const QUEUE_STATUS_PAUSED: QueueStatusKey;
|
|
250
248
|
export declare const QUEUE_SYMBOL: unique symbol;
|
|
251
|
-
//#endregion
|
|
252
249
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/queue.model.ts
|
|
2
2
|
/**
|
|
3
3
|
* An error thrown by the Queue when an operation fails
|
|
4
4
|
*/
|
|
@@ -19,11 +19,9 @@ const QUEUE_MESSAGE_MAXIMUM = "Queue has reached its maximum size";
|
|
|
19
19
|
const QUEUE_MESSAGE_REMOVE = "Item removed from queue";
|
|
20
20
|
const QUEUE_NAME_KEYED = "keyedQueue";
|
|
21
21
|
const QUEUE_NAME_QUEUE = "queue";
|
|
22
|
-
const QUEUE_PROPERTY = "$queue";
|
|
23
22
|
const QUEUE_STATUS_ACTIVE = "active";
|
|
24
23
|
const QUEUE_STATUS_EMPTY = "empty";
|
|
25
24
|
const QUEUE_STATUS_FULL = "full";
|
|
26
25
|
const QUEUE_STATUS_PAUSED = "paused";
|
|
27
|
-
const QUEUE_SYMBOL = Symbol(
|
|
28
|
-
|
|
29
|
-
export { QUEUE_ERROR_NAME, QUEUE_HANDLE_CLEAR, QUEUE_HANDLE_PAUSE, QUEUE_HANDLE_RESUME, QUEUE_MESSAGE_CALLBACK, QUEUE_MESSAGE_CLEAR, QUEUE_MESSAGE_KEY, QUEUE_MESSAGE_MAXIMUM, QUEUE_MESSAGE_REMOVE, QUEUE_NAME_KEYED, QUEUE_NAME_QUEUE, QUEUE_PROPERTY, QUEUE_STATUS_ACTIVE, QUEUE_STATUS_EMPTY, QUEUE_STATUS_FULL, QUEUE_STATUS_PAUSED, QUEUE_SYMBOL, QueueError };
|
|
26
|
+
const QUEUE_SYMBOL = Symbol("queue");
|
|
27
|
+
export { QUEUE_ERROR_NAME, QUEUE_HANDLE_CLEAR, QUEUE_HANDLE_PAUSE, QUEUE_HANDLE_RESUME, QUEUE_MESSAGE_CALLBACK, QUEUE_MESSAGE_CLEAR, QUEUE_MESSAGE_KEY, QUEUE_MESSAGE_MAXIMUM, QUEUE_MESSAGE_REMOVE, QUEUE_NAME_KEYED, QUEUE_NAME_QUEUE, QUEUE_STATUS_ACTIVE, QUEUE_STATUS_EMPTY, QUEUE_STATUS_FULL, QUEUE_STATUS_PAUSED, QUEUE_SYMBOL, QueueError };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
//#region src/models/random.model.d.ts
|
|
2
1
|
export declare const RANDOM_ALPHABET = "abcdefghijklmnopqrstuvwxyz";
|
|
3
2
|
export declare const RANDOM_BOOLEAN_MODIFIER = .5;
|
|
4
3
|
export declare const RANDOM_HEX_CHARACTERS = "0123456789ABCDEF";
|
|
5
|
-
export declare const RANDOM_HEX_MAXIMUM = 15;
|
|
6
|
-
//#endregion
|
|
4
|
+
export declare const RANDOM_HEX_MAXIMUM = 15;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/random.model.ts
|
|
2
2
|
const RANDOM_ALPHABET = "abcdefghijklmnopqrstuvwxyz";
|
|
3
3
|
const RANDOM_BOOLEAN_MODIFIER = .5;
|
|
4
4
|
const RANDOM_HEX_CHARACTERS = "0123456789ABCDEF";
|
|
5
5
|
const RANDOM_HEX_MAXIMUM = 15;
|
|
6
|
-
//#endregion
|
|
7
6
|
export { RANDOM_ALPHABET, RANDOM_BOOLEAN_MODIFIER, RANDOM_HEX_CHARACTERS, RANDOM_HEX_MAXIMUM };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { GenericCallback } from "./index.mjs";
|
|
2
|
-
//#region src/models/result.model.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* An unknown result
|
|
5
4
|
*/
|
|
@@ -68,5 +67,4 @@ type UnwrapResult<Original extends Result<unknown, unknown>> = Original extends
|
|
|
68
67
|
* Unwrap any value
|
|
69
68
|
*/
|
|
70
69
|
export type UnwrapValue<Original> = Original extends GenericCallback ? ReturnType<Original> extends Result<unknown, unknown> ? UnwrapResult<ReturnType<Original>> : ReturnType<Original> : Original extends Result<unknown, unknown> ? UnwrapResult<Original> : Original extends Promise<infer Value> ? Awaited<Value> : Original;
|
|
71
|
-
//#endregion
|
|
72
70
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/models/string/string.case.model.d.ts
|
|
2
1
|
export type StringCase = "camel" | "capitalize" | "kebab" | "lower" | "pascal" | "snake" | "title" | "upper";
|
|
3
2
|
export type StringCaseOptions = {
|
|
4
3
|
capitalizeAny: boolean;
|
|
@@ -20,5 +19,4 @@ export declare const STRING_DELIMITER_UNDERSCORE = "_";
|
|
|
20
19
|
export declare const STRING_EXPRESSION_CAMEL_CASE: RegExp;
|
|
21
20
|
export declare const STRING_EXPRESSION_ACRONYM: RegExp;
|
|
22
21
|
export declare const STRING_REPLACEMENT_CAMEL_CASE = "$1-$2";
|
|
23
|
-
export declare const ignoreCachingCases: Set<StringCase>;
|
|
24
|
-
//#endregion
|
|
22
|
+
export declare const ignoreCachingCases: Set<StringCase>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/string/string.case.model.ts
|
|
2
2
|
const STRING_CASE_CAMEL = "camel";
|
|
3
3
|
const STRING_CASE_CAPITALIZE = "capitalize";
|
|
4
4
|
const STRING_CASE_KEBAB = "kebab";
|
|
@@ -15,5 +15,4 @@ const STRING_EXPRESSION_CAMEL_CASE = /(\p{Ll})(\p{Lu})/gu;
|
|
|
15
15
|
const STRING_EXPRESSION_ACRONYM = /(?<=\p{Lu})(?=\p{Lu}\p{Ll})(?!\p{Lu}s(?!\p{Ll}))/gu;
|
|
16
16
|
const STRING_REPLACEMENT_CAMEL_CASE = "$1-$2";
|
|
17
17
|
const ignoreCachingCases = /* @__PURE__ */ new Set(["lower", "upper"]);
|
|
18
|
-
//#endregion
|
|
19
18
|
export { STRING_CASE_CAMEL, STRING_CASE_CAPITALIZE, STRING_CASE_KEBAB, STRING_CASE_LOWER, STRING_CASE_PASCAL, STRING_CASE_SNAKE, STRING_CASE_TITLE, STRING_CASE_UPPER, STRING_DELIMITER_EMPTY, STRING_DELIMITER_HYPHEN, STRING_DELIMITER_SPACE, STRING_DELIMITER_UNDERSCORE, STRING_EXPRESSION_ACRONYM, STRING_EXPRESSION_CAMEL_CASE, STRING_REPLACEMENT_CAMEL_CASE, ignoreCachingCases };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlainObject } from "../index.mjs";
|
|
2
|
-
//#region src/models/string/string.fuzzy.model.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Fuzzy searcher for an array of items
|
|
5
4
|
*/
|
|
@@ -129,8 +128,6 @@ export declare const FUZZY_BOUNDARY_SEPARATOR: RegExp;
|
|
|
129
128
|
export declare const FUZZY_LENGTH_DIVISOR = 3;
|
|
130
129
|
export declare const FUZZY_MESSAGE_ARRAY = "Fuzzy requires an array of items";
|
|
131
130
|
export declare const FUZZY_MESSAGE_HANDLER = "Fuzzy requires a key or function to stringify items";
|
|
132
|
-
export declare const FUZZY_PROPERTY = "$fuzzy";
|
|
133
131
|
export declare const FUZZY_PROXIMITY_THRESHOLD = 5;
|
|
134
132
|
export declare const FUZZY_SYMBOL: unique symbol;
|
|
135
|
-
//#endregion
|
|
136
133
|
export {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/string/string.fuzzy.model.ts
|
|
2
2
|
const FUZZY_BOUNDARY_BONUS = 2;
|
|
3
3
|
const FUZZY_BOUNDARY_SEPARATOR = /[\s./:\\_-]/;
|
|
4
4
|
const FUZZY_LENGTH_DIVISOR = 3;
|
|
5
5
|
const FUZZY_MESSAGE_ARRAY = "Fuzzy requires an array of items";
|
|
6
6
|
const FUZZY_MESSAGE_HANDLER = "Fuzzy requires a key or function to stringify items";
|
|
7
|
-
const FUZZY_PROPERTY = "$fuzzy";
|
|
8
7
|
const FUZZY_PROXIMITY_THRESHOLD = 5;
|
|
9
|
-
const FUZZY_SYMBOL = Symbol(
|
|
10
|
-
|
|
11
|
-
export { FUZZY_BOUNDARY_BONUS, FUZZY_BOUNDARY_SEPARATOR, FUZZY_LENGTH_DIVISOR, FUZZY_MESSAGE_ARRAY, FUZZY_MESSAGE_HANDLER, FUZZY_PROPERTY, FUZZY_PROXIMITY_THRESHOLD, FUZZY_SYMBOL };
|
|
8
|
+
const FUZZY_SYMBOL = Symbol("fuzzy");
|
|
9
|
+
export { FUZZY_BOUNDARY_BONUS, FUZZY_BOUNDARY_SEPARATOR, FUZZY_LENGTH_DIVISOR, FUZZY_MESSAGE_ARRAY, FUZZY_MESSAGE_HANDLER, FUZZY_PROXIMITY_THRESHOLD, FUZZY_SYMBOL };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/models/string/string.misc.model.d.ts
|
|
2
1
|
export type StringMatch = "endsWith" | "includes" | "startsWith";
|
|
3
2
|
export declare const STRING_DELIMITER_UUID_DEFAULT = "-";
|
|
4
3
|
export declare const STRING_DELIMITER_UUID_HTML = "_";
|
|
@@ -9,5 +8,4 @@ export declare const STRING_MATCH_ENDS_WITH: StringMatch;
|
|
|
9
8
|
export declare const STRING_MATCH_INCLUDES: StringMatch;
|
|
10
9
|
export declare const STRING_MATCH_STARTS_WITH: StringMatch;
|
|
11
10
|
export declare const STRING_NEWLINE = "\n";
|
|
12
|
-
export declare const STRING_ZERO = "0";
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare const STRING_ZERO = "0";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/string/string.misc.model.ts
|
|
2
2
|
const STRING_DELIMITER_UUID_DEFAULT = "-";
|
|
3
3
|
const STRING_DELIMITER_UUID_HTML = "_";
|
|
4
4
|
const STRING_EXPRESSION_IGNORED = /(^|\.)(__proto__|constructor|prototype)(\.|$)/i;
|
|
@@ -9,5 +9,4 @@ const STRING_MATCH_INCLUDES = "includes";
|
|
|
9
9
|
const STRING_MATCH_STARTS_WITH = "startsWith";
|
|
10
10
|
const STRING_NEWLINE = "\n";
|
|
11
11
|
const STRING_ZERO = "0";
|
|
12
|
-
//#endregion
|
|
13
12
|
export { STRING_DELIMITER_UUID_DEFAULT, STRING_DELIMITER_UUID_HTML, STRING_EXPRESSION_IGNORED, STRING_EXPRESSION_WHITESPACE_PREFIX, STRING_EXPRESSION_WORDS, STRING_MATCH_ENDS_WITH, STRING_MATCH_INCLUDES, STRING_MATCH_STARTS_WITH, STRING_NEWLINE, STRING_ZERO };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/models/string/string.normalize.model.d.ts
|
|
2
1
|
export type InternalNormalizer = {
|
|
3
2
|
[NORMALIZE_SYMBOL]: Required<NormalizeOptions>;
|
|
4
3
|
} & Normalizer;
|
|
@@ -81,5 +80,4 @@ export declare const NORMALIZE_NORMALIZATION_NORMALIZATION: string;
|
|
|
81
80
|
export declare const NORMALIZE_SPECIAL_PATTERN: RegExp;
|
|
82
81
|
export declare const NORMALIZE_SPECIAL_REPLACEMENT = "";
|
|
83
82
|
export declare const NORMALIZE_SYMBOL: unique symbol;
|
|
84
|
-
export declare const NORMALIZE_WHITESPACE_REPLACEMENT = " ";
|
|
85
|
-
//#endregion
|
|
83
|
+
export declare const NORMALIZE_WHITESPACE_REPLACEMENT = " ";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/string/string.normalize.model.ts
|
|
2
2
|
const NORMALIZE_DEBURR_CHARACTERS = {
|
|
3
3
|
Æ: "AE",
|
|
4
4
|
æ: "ae",
|
|
@@ -39,5 +39,4 @@ const NORMALIZE_SPECIAL_PATTERN = /[\p{P}\p{S}]/gu;
|
|
|
39
39
|
const NORMALIZE_SPECIAL_REPLACEMENT = "";
|
|
40
40
|
const NORMALIZE_SYMBOL = Symbol("normalize");
|
|
41
41
|
const NORMALIZE_WHITESPACE_REPLACEMENT = " ";
|
|
42
|
-
//#endregion
|
|
43
42
|
export { NORMALIZE_DEBURR_CHARACTERS, NORMALIZE_DEBURR_NORMALIZATION, NORMALIZE_DEBURR_PATTERN_CHARACTERS, NORMALIZE_DEBURR_PATTERN_SIMPLE, NORMALIZE_NORMALIZATION_NORMALIZATION, NORMALIZE_SPECIAL_PATTERN, NORMALIZE_SPECIAL_REPLACEMENT, NORMALIZE_SYMBOL, NORMALIZE_WHITESPACE_REPLACEMENT };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlainObject } from "../index.mjs";
|
|
2
|
-
//#region src/models/string/string.template.model.d.ts
|
|
3
2
|
export type InternalTemplater = {
|
|
4
3
|
[TEMPLATE_SYMBOL]: Required<TemplateOptions>;
|
|
5
4
|
} & Templater;
|
|
@@ -46,5 +45,4 @@ export type TemplaterOptions = Required<TemplateOptions>;
|
|
|
46
45
|
*/
|
|
47
46
|
export type TemplaterRenderer = (variables?: PlainObject) => string;
|
|
48
47
|
export declare const TEMPLATE_EXPRESSION_VARIABLE: RegExp;
|
|
49
|
-
export declare const TEMPLATE_SYMBOL: unique symbol;
|
|
50
|
-
//#endregion
|
|
48
|
+
export declare const TEMPLATE_SYMBOL: unique symbol;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/string/string.template.model.ts
|
|
2
2
|
const TEMPLATE_EXPRESSION_VARIABLE = /{{([^{}]+)}}/g;
|
|
3
3
|
const TEMPLATE_SYMBOL = Symbol("template");
|
|
4
|
-
//#endregion
|
|
5
4
|
export { TEMPLATE_EXPRESSION_VARIABLE, TEMPLATE_SYMBOL };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Key } from "./index.mjs";
|
|
2
1
|
import { Aborter } from "./aborter.model.mjs";
|
|
3
|
-
|
|
2
|
+
import { Key } from "./index.mjs";
|
|
4
3
|
export type InternalSubscription = {
|
|
5
4
|
[SUBSCRIPTION_SYMBOL]: SubscriptionState;
|
|
6
5
|
} & Subscription;
|
|
@@ -38,22 +37,10 @@ export type SubscriptionParameters = {
|
|
|
38
37
|
*/
|
|
39
38
|
value: unknown;
|
|
40
39
|
};
|
|
41
|
-
/**
|
|
42
|
-
* Property information for subscription identification
|
|
43
|
-
*/
|
|
44
|
-
export type SubscriptionProperty = {
|
|
45
|
-
/**
|
|
46
|
-
* Name of the property used to identify a subscription
|
|
47
|
-
*/
|
|
48
|
-
key: string;
|
|
49
|
-
/**
|
|
50
|
-
* Value of the property used to identify a subscription
|
|
51
|
-
*/
|
|
52
|
-
value: unknown;
|
|
53
|
-
};
|
|
54
40
|
export type SubscriptionState = {
|
|
55
41
|
aborter?: Aborter;
|
|
56
42
|
active: boolean;
|
|
43
|
+
name: string;
|
|
57
44
|
parameters: SubscriptionParameters;
|
|
58
45
|
subscriptions: SubscriptionsState;
|
|
59
46
|
};
|
|
@@ -94,15 +81,11 @@ export type SubscriptionsParameters = {
|
|
|
94
81
|
* Allow any or specific keys for subscriptions? _(defaults to `false`, which prevents keyed subscriptions)_
|
|
95
82
|
*/
|
|
96
83
|
keys?: boolean | Set<Key>;
|
|
97
|
-
/**
|
|
98
|
-
* Property information for subscription identification
|
|
99
|
-
*/
|
|
100
|
-
property?: SubscriptionProperty;
|
|
101
84
|
};
|
|
102
85
|
export type SubscriptionsState = {
|
|
103
86
|
items: SubscriptionsItems;
|
|
104
87
|
keys: boolean | Set<Key>;
|
|
105
|
-
|
|
88
|
+
name: string;
|
|
106
89
|
values: SubscriptionsValues;
|
|
107
90
|
};
|
|
108
91
|
export type SubscriptionsItems = {
|
|
@@ -121,7 +104,5 @@ export declare const SUBSCRIPTION_DISALLOWED_KEY = "Disallowed key for subscript
|
|
|
121
104
|
export declare const SUBSCRIPTION_INVALID_KEY = "Invalid key for subscription";
|
|
122
105
|
export declare const SUBSCRIPTION_INVALID_VALUE = "A subscription requires a non-null value to identify it";
|
|
123
106
|
export declare const SUBSCRIPTION_NAME = "subscription";
|
|
124
|
-
export declare const SUBSCRIPTION_PROPERTY = "$subscription";
|
|
125
107
|
export declare const SUBSCRIPTION_STORE = "subscriptions";
|
|
126
|
-
export declare const SUBSCRIPTION_SYMBOL: unique symbol;
|
|
127
|
-
//#endregion
|
|
108
|
+
export declare const SUBSCRIPTION_SYMBOL: unique symbol;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/subscription.model.ts
|
|
2
2
|
const SUBSCRIPTION_DISALLOWED_KEY = "Disallowed key for subscription";
|
|
3
3
|
const SUBSCRIPTION_INVALID_KEY = "Invalid key for subscription";
|
|
4
4
|
const SUBSCRIPTION_INVALID_VALUE = "A subscription requires a non-null value to identify it";
|
|
5
5
|
const SUBSCRIPTION_NAME = "subscription";
|
|
6
|
-
const SUBSCRIPTION_PROPERTY = "$subscription";
|
|
7
6
|
const SUBSCRIPTION_STORE = "subscriptions";
|
|
8
|
-
const SUBSCRIPTION_SYMBOL = Symbol(
|
|
9
|
-
|
|
10
|
-
export { SUBSCRIPTION_DISALLOWED_KEY, SUBSCRIPTION_INVALID_KEY, SUBSCRIPTION_INVALID_VALUE, SUBSCRIPTION_NAME, SUBSCRIPTION_PROPERTY, SUBSCRIPTION_STORE, SUBSCRIPTION_SYMBOL };
|
|
7
|
+
const SUBSCRIPTION_SYMBOL = Symbol("subscription");
|
|
8
|
+
export { SUBSCRIPTION_DISALLOWED_KEY, SUBSCRIPTION_INVALID_KEY, SUBSCRIPTION_INVALID_VALUE, SUBSCRIPTION_NAME, SUBSCRIPTION_STORE, SUBSCRIPTION_SYMBOL };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Constructor } from "../index.mjs";
|
|
2
|
-
//#region src/models/value/value.clone.model.d.ts
|
|
3
2
|
export type CloneOptions = {
|
|
4
3
|
/**
|
|
5
4
|
* Copy functions instead of returning `undefined`? _(defaults to `false`)_
|
|
@@ -52,5 +51,4 @@ export declare const CLONE_COPY_OPTIONS: Required<CloneOptions>;
|
|
|
52
51
|
export declare const CLONE_DEFAULT_OPTIONS: Required<CloneOptions>;
|
|
53
52
|
export declare const CLONE_MAX_DEPTH = 100;
|
|
54
53
|
export declare const CLONE_PRIMITIVES: Record<string, boolean>;
|
|
55
|
-
export declare const CLONE_SYMBOL: unique symbol;
|
|
56
|
-
//#endregion
|
|
54
|
+
export declare const CLONE_SYMBOL: unique symbol;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/value/value.clone.model.ts
|
|
2
2
|
const CLONE_NAME = "clone";
|
|
3
3
|
const CLONE_COPY_OPTIONS = {
|
|
4
4
|
copyFunctions: true,
|
|
@@ -20,5 +20,4 @@ const CLONE_PRIMITIVES = {
|
|
|
20
20
|
undefined: true
|
|
21
21
|
};
|
|
22
22
|
const CLONE_SYMBOL = Symbol(CLONE_NAME);
|
|
23
|
-
//#endregion
|
|
24
23
|
export { CLONE_COPY_OPTIONS, CLONE_DEFAULT_OPTIONS, CLONE_MAX_DEPTH, CLONE_NAME, CLONE_PRIMITIVES, CLONE_SYMBOL };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/models/value/value.diff.model.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Options for value comparison
|
|
4
3
|
*/
|
|
@@ -57,5 +56,4 @@ export type DiffParameters = {
|
|
|
57
56
|
};
|
|
58
57
|
export declare const DIFF_FULL: DiffType;
|
|
59
58
|
export declare const DIFF_NONE: DiffType;
|
|
60
|
-
export declare const DIFF_PARTIAL: DiffType;
|
|
61
|
-
//#endregion
|
|
59
|
+
export declare const DIFF_PARTIAL: DiffType;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Constructor } from "../index.mjs";
|
|
2
|
-
//#region src/models/value/value.equal.model.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Options for value equality comparison
|
|
5
4
|
*/
|
|
@@ -73,5 +72,4 @@ export declare const EQUAL_ERROR_PROPERTIES: string[];
|
|
|
73
72
|
export declare const EQUAL_EXPRESSION_PROPERTIES: string[];
|
|
74
73
|
export declare const EQUAL_MINIMUM_LENGTH_FOR_SET = 16;
|
|
75
74
|
export declare const EQUAL_SYMBOL: unique symbol;
|
|
76
|
-
//#endregion
|
|
77
75
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/value/value.equal.model.ts
|
|
2
2
|
const EQUAL_ARRAY_PEEK_PERCENTAGE = 10;
|
|
3
3
|
const EQUAL_ARRAY_THRESHOLD = 100;
|
|
4
4
|
const EQUAL_ERROR_PROPERTIES = ["name", "message"];
|
|
5
5
|
const EQUAL_EXPRESSION_PROPERTIES = ["source", "flags"];
|
|
6
6
|
const EQUAL_MINIMUM_LENGTH_FOR_SET = 16;
|
|
7
7
|
const EQUAL_SYMBOL = Symbol("equal");
|
|
8
|
-
//#endregion
|
|
9
8
|
export { EQUAL_ARRAY_PEEK_PERCENTAGE, EQUAL_ARRAY_THRESHOLD, EQUAL_ERROR_PROPERTIES, EQUAL_EXPRESSION_PROPERTIES, EQUAL_MINIMUM_LENGTH_FOR_SET, EQUAL_SYMBOL };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Constructor, GenericCallback } from "../index.mjs";
|
|
2
|
-
//#region src/models/value/value.handler.model.d.ts
|
|
3
2
|
export type BaseHandler = {
|
|
4
3
|
handlers: WeakMap<WeakKey, string | GenericCallback>;
|
|
5
4
|
options: BaseHandlerOptions;
|
|
@@ -23,5 +22,4 @@ export type Handleable = Record<string, GenericCallback>;
|
|
|
23
22
|
export type ValueHandler = {
|
|
24
23
|
base: BaseHandler;
|
|
25
24
|
handle(value: unknown, ...parameters: unknown[]): unknown;
|
|
26
|
-
};
|
|
27
|
-
//#endregion
|
|
25
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ArrayOrPlainObject, NestedPartial, PlainObject, UnionToIntersection } from "../index.mjs";
|
|
2
|
-
//#region src/models/value/value.merge.model.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Options for assigning values
|
|
5
4
|
*/
|
|
@@ -79,5 +78,4 @@ export type MergingOptions = {
|
|
|
79
78
|
};
|
|
80
79
|
export declare const MERGE_SYMBOL_ASSIGN: unique symbol;
|
|
81
80
|
export declare const MERGE_SYMBOL_MERGE: unique symbol;
|
|
82
|
-
//#endregion
|
|
83
81
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { NestedKeys, NestedValue, PlainObject, Simplify, ToString, UnionToIntersection } from "../index.mjs";
|
|
2
|
-
//#region src/models/value/value.misc.model.d.ts
|
|
3
2
|
export type ComparisonHandler<Value = any> = (first: Value, second: Value) => number;
|
|
4
3
|
/**
|
|
5
4
|
* Thanks, type-fest!
|
|
@@ -30,5 +29,4 @@ export declare const VALUE_MISC_NESTED_MESSAGE_MISSING = "Expected property to e
|
|
|
30
29
|
export declare const VALUE_MISC_NESTED_MESSAGE_PATH = "Expected path to be a string";
|
|
31
30
|
export declare const VALUE_MISC_NESTED_MESSAGE_UNSAFE = "Access to this property is not allowed";
|
|
32
31
|
export declare const SMUSH_MAX_DEPTH = 100;
|
|
33
|
-
//#endregion
|
|
34
32
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/models/value/value.misc.model.ts
|
|
2
2
|
const COMPARE_NAME = "compare";
|
|
3
3
|
const VALUE_MISC_EXPRESSION_BRACKET = /\[(\w+)\]/g;
|
|
4
4
|
const VALUE_MISC_EXPRESSION_DOTS = /^\.|\.$/g;
|
|
@@ -8,5 +8,4 @@ const VALUE_MISC_NESTED_MESSAGE_MISSING = "Expected property to exist in object"
|
|
|
8
8
|
const VALUE_MISC_NESTED_MESSAGE_PATH = "Expected path to be a string";
|
|
9
9
|
const VALUE_MISC_NESTED_MESSAGE_UNSAFE = "Access to this property is not allowed";
|
|
10
10
|
const SMUSH_MAX_DEPTH = 100;
|
|
11
|
-
//#endregion
|
|
12
11
|
export { COMPARE_NAME, SMUSH_MAX_DEPTH, VALUE_MISC_EXPRESSION_BRACKET, VALUE_MISC_EXPRESSION_DOTS, VALUE_MISC_EXPRESSION_NESTED, VALUE_MISC_NESTED_MESSAGE_INPUT, VALUE_MISC_NESTED_MESSAGE_MISSING, VALUE_MISC_NESTED_MESSAGE_PATH, VALUE_MISC_NESTED_MESSAGE_UNSAFE };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlainObject } from "../index.mjs";
|
|
2
|
-
//#region src/models/value/value.transform.model.d.ts
|
|
3
2
|
export type InternalTransformer<Value extends PlainObject> = {
|
|
4
3
|
[TRANSFORM_SYMBOL]: TransformHandler<Value>;
|
|
5
4
|
} & Transformer<Value>;
|
|
@@ -24,5 +23,4 @@ export type Transformer<Value extends PlainObject> = {
|
|
|
24
23
|
*/
|
|
25
24
|
transform(value: Value): Value;
|
|
26
25
|
};
|
|
27
|
-
export declare const TRANSFORM_SYMBOL: unique symbol;
|
|
28
|
-
//#endregion
|
|
26
|
+
export declare const TRANSFORM_SYMBOL: unique symbol;
|
package/dist/plan/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AsyncPlan, Plan } from "../models/plan.model.mjs";
|
|
2
|
-
//#region src/plan/index.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Create a plan for an asynchronous generator function
|
|
5
4
|
*
|
|
@@ -13,5 +12,4 @@ export declare function plan<Yielded, Returned, Parameters extends unknown[]>(ge
|
|
|
13
12
|
* @param generator Generator to plan for
|
|
14
13
|
* @returns Generator plan
|
|
15
14
|
*/
|
|
16
|
-
export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>): Plan<Yielded, Returned, Parameters>;
|
|
17
|
-
//#endregion
|
|
15
|
+
export declare function plan<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>): Plan<Yielded, Returned, Parameters>;
|
package/dist/plan/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PLAN_MESSAGE_PLAN_INPUT, PLAN_SYMBOL, PLAN_TYPE_ASYNC, PLAN_TYPE_SYNC } from "../models/plan.model.mjs";
|
|
2
1
|
import { attemptRunPlan, getGenerator, runAsyncPlan, runPlan } from "../internal/plan/index.mjs";
|
|
2
|
+
import { PLAN_MESSAGE_PLAN_INPUT, PLAN_SYMBOL, PLAN_TYPE_ASYNC, PLAN_TYPE_SYNC } from "../models/plan.model.mjs";
|
|
3
3
|
import { isAsyncGeneratorFunction, isGeneratorFunction } from "./is.mjs";
|
|
4
4
|
import { asyncAttemptRun } from "./result.mjs";
|
|
5
|
-
|
|
5
|
+
// src/plan/index.ts
|
|
6
6
|
function AsyncPlan(generator) {
|
|
7
7
|
this[PLAN_SYMBOL] = {
|
|
8
8
|
generator,
|
|
@@ -29,5 +29,4 @@ function plan(generator) {
|
|
|
29
29
|
if (isGeneratorFunction(generator)) return new Plan(generator);
|
|
30
30
|
throw new Error(PLAN_MESSAGE_PLAN_INPUT);
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { plan };
|
package/dist/plan/is.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AsyncFailure, AsyncPlan, AsyncStep, AsyncSuccess, Failure, Plan, Step, Success } from "../models/plan.model.mjs";
|
|
2
|
-
//#region src/plan/is.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Is the value an asynchronous, immediately failing plan?
|
|
5
4
|
*
|
|
@@ -83,5 +82,4 @@ export declare function isStep<Value = unknown>(value: unknown): value is Step<V
|
|
|
83
82
|
* @param value Value to check
|
|
84
83
|
* @returns `true` if the value is an immediately successful plan, otherwise `false`
|
|
85
84
|
*/
|
|
86
|
-
export declare function isSuccess<Value = unknown>(value: unknown): value is Success<Value>;
|
|
87
|
-
//#endregion
|
|
85
|
+
export declare function isSuccess<Value = unknown>(value: unknown): value is Success<Value>;
|
package/dist/plan/is.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GENERATOR_FUNCTION_TYPE_ASYNC, GENERATOR_FUNCTION_TYPE_SYNC, GENERATOR_TYPE_ASYNC, GENERATOR_TYPE_SYNC, PLAN_FAILURE_ASYNC, PLAN_FAILURE_SYNC, PLAN_STEP_ASYNC, PLAN_STEP_SYNC, PLAN_SUCCESS_ASYNC, PLAN_SUCCESS_SYNC, PLAN_SYMBOL, PLAN_TYPE_ASYNC, PLAN_TYPE_SYNC } from "../models/plan.model.mjs";
|
|
2
|
-
|
|
2
|
+
// src/plan/is.ts
|
|
3
3
|
/**
|
|
4
4
|
* Is the value an asynchronous, immediately failing plan?
|
|
5
5
|
*
|
|
@@ -114,5 +114,4 @@ function isStep(value) {
|
|
|
114
114
|
function isSuccess(value) {
|
|
115
115
|
return isPlanInstance(PLAN_SUCCESS_SYNC, value);
|
|
116
116
|
}
|
|
117
|
-
//#endregion
|
|
118
117
|
export { isAsyncFailure, isAsyncGenerator, isAsyncGeneratorFunction, isAsyncPlan, isAsyncStep, isAsyncSuccess, isFailure, isGenerator, isGeneratorFunction, isPlan, isStep, isSuccess };
|
package/dist/plan/misc.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AsyncFailure, AsyncSuccess, Failure, Success } from "../models/plan.model.mjs";
|
|
2
|
-
//#region src/plan/misc.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Create an immediately failing plan
|
|
5
4
|
*
|
|
@@ -61,5 +60,4 @@ export declare namespace fail {
|
|
|
61
60
|
}
|
|
62
61
|
export declare namespace succeed {
|
|
63
62
|
export var async: typeof asyncSucceed;
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
63
|
+
}
|
package/dist/plan/misc.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { getGenerator } from "../internal/plan/index.mjs";
|
|
1
2
|
import { error } from "../internal/result/misc.mjs";
|
|
2
3
|
import { PLAN_FAILURE_ASYNC, PLAN_FAILURE_SYNC, PLAN_SUCCESS_ASYNC, PLAN_SUCCESS_SYNC, PLAN_SYMBOL } from "../models/plan.model.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/plan/misc.ts
|
|
4
|
+
// src/plan/misc.ts
|
|
5
5
|
function AsyncFailure(generator) {
|
|
6
6
|
this[PLAN_SYMBOL] = {
|
|
7
7
|
generator,
|
|
@@ -52,5 +52,4 @@ function succeed(value) {
|
|
|
52
52
|
}
|
|
53
53
|
fail.async = asyncFail;
|
|
54
54
|
succeed.async = asyncSucceed;
|
|
55
|
-
//#endregion
|
|
56
55
|
export { asyncFail, asyncSucceed, fail, succeed };
|
package/dist/plan/models.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AsyncFailure,
|
|
2
|
-
export type { AsyncFailure,
|
|
1
|
+
import { AsyncFailure, AsyncImmediate, AsyncPlan, AsyncStep, AsyncSuccess, Failure, Immediate, Plan, PlannedError, PlannedOk, PlannedReturned, Step, Success } from "../models/plan.model.mjs";
|
|
2
|
+
export type { AsyncFailure, AsyncImmediate, AsyncPlan, AsyncStep, AsyncSuccess, Failure, Immediate, Plan, PlannedError, PlannedOk, PlannedReturned, Step, Success };
|
package/dist/plan/result.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { AsyncPlan, Plan, PlannedError, PlannedOk } from "../models/plan.model.mjs";
|
|
1
2
|
import { Result } from "../models/result.model.mjs";
|
|
2
|
-
import { AsyncPlan, Plan, PlanError, PlanOk } from "../models/plan.model.mjs";
|
|
3
|
-
//#region src/plan/result.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Attempt to run the generator to completion
|
|
6
5
|
*
|
|
@@ -11,7 +10,7 @@ import { AsyncPlan, Plan, PlanError, PlanOk } from "../models/plan.model.mjs";
|
|
|
11
10
|
* @param signal Optional abort signal
|
|
12
11
|
* @returns Promised result
|
|
13
12
|
*/
|
|
14
|
-
export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, parameters: Parameters, signal?: AbortSignal): Promise<Result<
|
|
13
|
+
export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, parameters: Parameters, signal?: AbortSignal): Promise<Result<PlannedOk<Returned>, PlannedError<Yielded, Returned>>>;
|
|
15
14
|
/**
|
|
16
15
|
* Attempt to run the generator to completion
|
|
17
16
|
*
|
|
@@ -21,7 +20,7 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
|
|
|
21
20
|
* @param signal Optional abort signal
|
|
22
21
|
* @returns Promised result
|
|
23
22
|
*/
|
|
24
|
-
export declare function asyncAttemptRun<Yielded, Returned>(generator: () => AsyncGenerator<Yielded, Returned>, signal?: AbortSignal): Promise<Result<
|
|
23
|
+
export declare function asyncAttemptRun<Yielded, Returned>(generator: () => AsyncGenerator<Yielded, Returned>, signal?: AbortSignal): Promise<Result<PlannedOk<Returned>, PlannedError<Yielded, Returned>>>;
|
|
25
24
|
/**
|
|
26
25
|
* Attempt to run the plan to completion
|
|
27
26
|
*
|
|
@@ -32,7 +31,7 @@ export declare function asyncAttemptRun<Yielded, Returned>(generator: () => Asyn
|
|
|
32
31
|
* @param signal Optional abort signal
|
|
33
32
|
* @returns Promised result
|
|
34
33
|
*/
|
|
35
|
-
export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, parameters: Parameters, signal?: AbortSignal): Promise<Result<
|
|
34
|
+
export declare function asyncAttemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, parameters: Parameters, signal?: AbortSignal): Promise<Result<PlannedOk<Returned>, PlannedError<Yielded, Returned>>>;
|
|
36
35
|
/**
|
|
37
36
|
* Attempt to run the plan to completion
|
|
38
37
|
*
|
|
@@ -42,7 +41,7 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
|
|
|
42
41
|
* @param signal Optional abort signal
|
|
43
42
|
* @returns Promised result
|
|
44
43
|
*/
|
|
45
|
-
export declare function asyncAttemptRun<Yielded, Returned>(plan: AsyncPlan<Yielded, Returned, []>, signal?: AbortSignal): Promise<Result<
|
|
44
|
+
export declare function asyncAttemptRun<Yielded, Returned>(plan: AsyncPlan<Yielded, Returned, []>, signal?: AbortSignal): Promise<Result<PlannedOk<Returned>, PlannedError<Yielded, Returned>>>;
|
|
46
45
|
/**
|
|
47
46
|
* Attempt to run the generator to completion
|
|
48
47
|
*
|
|
@@ -52,7 +51,7 @@ export declare function asyncAttemptRun<Yielded, Returned>(plan: AsyncPlan<Yield
|
|
|
52
51
|
* @param parameters Parameters for starting the run
|
|
53
52
|
* @returns Result
|
|
54
53
|
*/
|
|
55
|
-
export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>, ...parameters: Parameters): Result<
|
|
54
|
+
export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>, ...parameters: Parameters): Result<PlannedOk<Returned>, PlannedError<Yielded, Returned>>;
|
|
56
55
|
/**
|
|
57
56
|
* Attempt to run the plan to completion
|
|
58
57
|
*
|
|
@@ -62,8 +61,7 @@ export declare function attemptRun<Yielded, Returned, Parameters extends unknown
|
|
|
62
61
|
* @param parameters Parameters for starting the run
|
|
63
62
|
* @returns Result
|
|
64
63
|
*/
|
|
65
|
-
export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): Result<
|
|
64
|
+
export declare function attemptRun<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): Result<PlannedOk<Returned>, PlannedError<Yielded, Returned>>;
|
|
66
65
|
export declare namespace attemptRun {
|
|
67
66
|
export var async: typeof asyncAttemptRun;
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
67
|
+
}
|
package/dist/plan/result.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { asyncGenerate, generate } from "../internal/plan/plan.generate.mjs";
|
|
1
2
|
import { asyncAttempt, attempt } from "../internal/result/attempt.mjs";
|
|
2
3
|
import { PLAN_MESSAGE_RUN_INPUT, PLAN_SYMBOL } from "../models/plan.model.mjs";
|
|
3
|
-
import { asyncGenerate, generate } from "../internal/plan/plan.generate.mjs";
|
|
4
4
|
import { isAsyncGeneratorFunction, isAsyncPlan, isGeneratorFunction, isPlan } from "./is.mjs";
|
|
5
|
-
|
|
5
|
+
// src/plan/result.ts
|
|
6
6
|
function asyncAttemptRun(input, first, second) {
|
|
7
7
|
let generator;
|
|
8
8
|
if (isAsyncPlan(input)) generator = input[PLAN_SYMBOL];
|
|
@@ -18,5 +18,4 @@ function attemptRun(input, ...parameters) {
|
|
|
18
18
|
return attempt(() => generate(generator, parameters, true));
|
|
19
19
|
}
|
|
20
20
|
attemptRun.async = asyncAttemptRun;
|
|
21
|
-
//#endregion
|
|
22
21
|
export { asyncAttemptRun, attemptRun };
|