@oscarpalmer/atoms 0.222.0 → 0.223.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array/difference.mjs +1 -1
- package/dist/array/exists.mjs +10 -4
- package/dist/array/filter.mjs +14 -4
- package/dist/array/find.mjs +8 -3
- package/dist/array/first.mjs +9 -3
- package/dist/array/index.d.mts +4 -4
- package/dist/array/insert.mjs +1 -1
- package/dist/array/intersection.mjs +1 -1
- package/dist/array/last.mjs +11 -3
- package/dist/array/partition.mjs +23 -3
- package/dist/array/push.mjs +1 -1
- package/dist/array/select.mjs +39 -7
- package/dist/array/single.mjs +8 -5
- package/dist/array/sort.mjs +1 -1
- package/dist/array/splice.mjs +1 -1
- package/dist/array/swap.mjs +1 -1
- package/dist/array/union.mjs +1 -1
- package/dist/array/unique.mjs +17 -3
- package/dist/beacon.d.mts +3 -11
- package/dist/beacon.mjs +10 -20
- package/dist/color/constants.d.mts +1 -5
- package/dist/color/constants.mjs +2 -9
- package/dist/color/index.mjs +3 -3
- package/dist/color/instance.mjs +4 -6
- package/dist/color/misc/get.mjs +1 -1
- package/dist/color/misc/is.d.mts +0 -8
- package/dist/color/misc/is.mjs +3 -14
- package/dist/color/misc/state.mjs +3 -3
- package/dist/color/space/hex.mjs +1 -1
- package/dist/color/space/hsl.mjs +1 -1
- package/dist/color/space/hwb.mjs +2 -2
- package/dist/function/limit.d.mts +1 -1
- package/dist/function/limit.mjs +1 -1
- package/dist/function/once.d.mts +1 -1
- package/dist/function/once.mjs +7 -7
- package/dist/function/retry.d.mts +1 -1
- package/dist/function/retry.mjs +10 -10
- package/dist/herald.d.mts +2 -2
- package/dist/herald.mjs +1 -1
- package/dist/index.d.mts +80 -91
- package/dist/index.mjs +352 -334
- package/dist/internal/array/callbacks.d.mts +1 -1
- package/dist/internal/array/find.d.mts +2 -6
- package/dist/internal/array/find.mjs +30 -122
- package/dist/internal/array/index-of.mjs +9 -3
- package/dist/internal/array/insert.mjs +1 -1
- package/dist/internal/array/match.d.mts +1 -1
- package/dist/internal/array/match.mjs +1 -1
- package/dist/internal/array/sets.mjs +4 -4
- package/dist/internal/function/assert.d.mts +1 -1
- package/dist/internal/function/limit.d.mts +1 -1
- package/dist/internal/function/limit.mjs +7 -7
- package/dist/internal/function/memoize.d.mts +1 -1
- package/dist/internal/function/memoize.mjs +3 -3
- package/dist/internal/function/work.d.mts +1 -1
- package/dist/internal/function/work.mjs +1 -1
- package/dist/internal/herald.d.mts +2 -10
- package/dist/internal/herald.mjs +8 -31
- package/dist/internal/math/aggregate.mjs +1 -1
- package/dist/internal/number.mjs +1 -1
- package/dist/internal/plan/index.mjs +1 -1
- package/dist/internal/plan/plan.generate.mjs +67 -21
- package/dist/internal/sized/map.d.mts +3 -0
- package/dist/internal/sized/map.mjs +3 -0
- package/dist/internal/string/case.mjs +2 -2
- package/dist/internal/string/misc.mjs +1 -1
- package/dist/internal/subscription.mjs +15 -27
- package/dist/internal/value/compare.mjs +1 -1
- package/dist/internal/value/equal.d.mts +1 -1
- package/dist/internal/value/equal.mjs +2 -2
- package/dist/internal/value/set.mjs +1 -1
- package/dist/is.mjs +1 -1
- package/dist/logger.mjs +6 -5
- package/dist/math.mjs +1 -1
- package/dist/models/array/array.misc.model.d.mts +12 -1
- package/dist/models/array/array.misc.model.mjs +2 -1
- package/dist/models/beacon.model.d.mts +4 -4
- package/dist/models/beacon.model.mjs +2 -8
- package/dist/models/color.model.d.mts +2 -2
- package/dist/models/function/limiter.model.d.mts +1 -1
- package/dist/models/function/limiter.model.mjs +1 -2
- package/dist/models/function/memoize.model.d.mts +1 -1
- package/dist/models/function/once.model.d.mts +0 -1
- package/dist/models/function/once.model.mjs +2 -3
- package/dist/models/function/work.model.d.mts +1 -1
- package/dist/models/herald.model.d.mts +8 -5
- package/dist/models/herald.model.mjs +2 -8
- package/dist/models/logger.model.d.mts +0 -1
- package/dist/models/logger.model.mjs +2 -3
- package/dist/models/plan.model.d.mts +35 -35
- package/dist/models/promise.model.d.mts +7 -7
- package/dist/models/promise.model.mjs +3 -3
- package/dist/models/queue.model.d.mts +0 -1
- package/dist/models/queue.model.mjs +2 -3
- package/dist/models/string/string.fuzzy.model.d.mts +0 -1
- package/dist/models/string/string.fuzzy.model.mjs +2 -3
- package/dist/models/subscription.model.d.mts +3 -20
- package/dist/models/subscription.model.mjs +2 -3
- package/dist/plan/index.mjs +1 -1
- package/dist/plan/misc.mjs +1 -1
- package/dist/plan/models.d.mts +2 -2
- package/dist/plan/result.d.mts +7 -7
- package/dist/plan/result.mjs +1 -1
- package/dist/plan/run.d.mts +7 -7
- package/dist/plan/run.mjs +1 -1
- package/dist/plan/use.mjs +13 -7
- package/dist/promise/delay.mjs +1 -1
- package/dist/promise/helpers.mjs +1 -1
- package/dist/promise/index.mjs +4 -4
- package/dist/promise/misc.d.mts +1 -1
- package/dist/promise/misc.mjs +1 -1
- package/dist/promise/models.d.mts +2 -2
- package/dist/promise/models.mjs +1 -1
- package/dist/promise/timed.mjs +3 -3
- package/dist/query.mjs +1 -1
- package/dist/queue.mjs +10 -10
- package/dist/random.mjs +1 -1
- package/dist/result/work/flow.mjs +1 -1
- package/dist/result/work/pipe.mjs +1 -1
- package/dist/sized/set.d.mts +3 -0
- package/dist/sized/set.mjs +3 -0
- package/dist/string/fuzzy.mjs +4 -5
- package/dist/string/index.mjs +1 -1
- package/dist/string/match.mjs +1 -1
- package/dist/string/normalize.mjs +2 -2
- package/dist/subscription.d.mts +2 -2
- package/dist/value/clone.d.mts +1 -1
- package/dist/value/clone.mjs +1 -1
- package/dist/value/freeze.mjs +1 -1
- package/dist/value/handle.mjs +1 -1
- package/dist/value/smush.mjs +1 -1
- package/package.json +6 -6
- package/dist/models/array/array.find.model.d.mts +0 -46
- package/dist/models/array/array.find.model.mjs +0 -7
|
@@ -19,10 +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
|
-
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,
|
|
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 };
|
|
@@ -128,7 +128,6 @@ export declare const FUZZY_BOUNDARY_SEPARATOR: RegExp;
|
|
|
128
128
|
export declare const FUZZY_LENGTH_DIVISOR = 3;
|
|
129
129
|
export declare const FUZZY_MESSAGE_ARRAY = "Fuzzy requires an array of items";
|
|
130
130
|
export declare const FUZZY_MESSAGE_HANDLER = "Fuzzy requires a key or function to stringify items";
|
|
131
|
-
export declare const FUZZY_PROPERTY = "$fuzzy";
|
|
132
131
|
export declare const FUZZY_PROXIMITY_THRESHOLD = 5;
|
|
133
132
|
export declare const FUZZY_SYMBOL: unique symbol;
|
|
134
133
|
export {};
|
|
@@ -4,7 +4,6 @@ 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
|
-
export { FUZZY_BOUNDARY_BONUS, FUZZY_BOUNDARY_SEPARATOR, FUZZY_LENGTH_DIVISOR, FUZZY_MESSAGE_ARRAY, FUZZY_MESSAGE_HANDLER,
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { Key } from "./index.mjs";
|
|
2
1
|
import { Aborter } from "./aborter.model.mjs";
|
|
2
|
+
import { Key } from "./index.mjs";
|
|
3
3
|
export type InternalSubscription = {
|
|
4
4
|
[SUBSCRIPTION_SYMBOL]: SubscriptionState;
|
|
5
5
|
} & Subscription;
|
|
@@ -37,22 +37,10 @@ export type SubscriptionParameters = {
|
|
|
37
37
|
*/
|
|
38
38
|
value: unknown;
|
|
39
39
|
};
|
|
40
|
-
/**
|
|
41
|
-
* Property information for subscription identification
|
|
42
|
-
*/
|
|
43
|
-
export type SubscriptionProperty = {
|
|
44
|
-
/**
|
|
45
|
-
* Name of the property used to identify a subscription
|
|
46
|
-
*/
|
|
47
|
-
key: string;
|
|
48
|
-
/**
|
|
49
|
-
* Value of the property used to identify a subscription
|
|
50
|
-
*/
|
|
51
|
-
value: unknown;
|
|
52
|
-
};
|
|
53
40
|
export type SubscriptionState = {
|
|
54
41
|
aborter?: Aborter;
|
|
55
42
|
active: boolean;
|
|
43
|
+
name: string;
|
|
56
44
|
parameters: SubscriptionParameters;
|
|
57
45
|
subscriptions: SubscriptionsState;
|
|
58
46
|
};
|
|
@@ -93,15 +81,11 @@ export type SubscriptionsParameters = {
|
|
|
93
81
|
* Allow any or specific keys for subscriptions? _(defaults to `false`, which prevents keyed subscriptions)_
|
|
94
82
|
*/
|
|
95
83
|
keys?: boolean | Set<Key>;
|
|
96
|
-
/**
|
|
97
|
-
* Property information for subscription identification
|
|
98
|
-
*/
|
|
99
|
-
property?: SubscriptionProperty;
|
|
100
84
|
};
|
|
101
85
|
export type SubscriptionsState = {
|
|
102
86
|
items: SubscriptionsItems;
|
|
103
87
|
keys: boolean | Set<Key>;
|
|
104
|
-
|
|
88
|
+
name: string;
|
|
105
89
|
values: SubscriptionsValues;
|
|
106
90
|
};
|
|
107
91
|
export type SubscriptionsItems = {
|
|
@@ -120,6 +104,5 @@ export declare const SUBSCRIPTION_DISALLOWED_KEY = "Disallowed key for subscript
|
|
|
120
104
|
export declare const SUBSCRIPTION_INVALID_KEY = "Invalid key for subscription";
|
|
121
105
|
export declare const SUBSCRIPTION_INVALID_VALUE = "A subscription requires a non-null value to identify it";
|
|
122
106
|
export declare const SUBSCRIPTION_NAME = "subscription";
|
|
123
|
-
export declare const SUBSCRIPTION_PROPERTY = "$subscription";
|
|
124
107
|
export declare const SUBSCRIPTION_STORE = "subscriptions";
|
|
125
108
|
export declare const SUBSCRIPTION_SYMBOL: unique symbol;
|
|
@@ -3,7 +3,6 @@ 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
|
-
export { SUBSCRIPTION_DISALLOWED_KEY, SUBSCRIPTION_INVALID_KEY, SUBSCRIPTION_INVALID_VALUE, SUBSCRIPTION_NAME,
|
|
7
|
+
const SUBSCRIPTION_SYMBOL = Symbol("subscription");
|
|
8
|
+
export { SUBSCRIPTION_DISALLOWED_KEY, SUBSCRIPTION_INVALID_KEY, SUBSCRIPTION_INVALID_VALUE, SUBSCRIPTION_NAME, SUBSCRIPTION_STORE, SUBSCRIPTION_SYMBOL };
|
package/dist/plan/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
package/dist/plan/misc.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
import { getGenerator } from "../internal/plan/index.mjs";
|
|
4
4
|
// src/plan/misc.ts
|
|
5
5
|
function AsyncFailure(generator) {
|
|
6
6
|
this[PLAN_SYMBOL] = {
|
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,5 +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
3
|
/**
|
|
4
4
|
* Attempt to run the generator to completion
|
|
5
5
|
*
|
|
@@ -10,7 +10,7 @@ import { AsyncPlan, Plan, PlanError, PlanOk } from "../models/plan.model.mjs";
|
|
|
10
10
|
* @param signal Optional abort signal
|
|
11
11
|
* @returns Promised result
|
|
12
12
|
*/
|
|
13
|
-
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>>>;
|
|
14
14
|
/**
|
|
15
15
|
* Attempt to run the generator to completion
|
|
16
16
|
*
|
|
@@ -20,7 +20,7 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
|
|
|
20
20
|
* @param signal Optional abort signal
|
|
21
21
|
* @returns Promised result
|
|
22
22
|
*/
|
|
23
|
-
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>>>;
|
|
24
24
|
/**
|
|
25
25
|
* Attempt to run the plan to completion
|
|
26
26
|
*
|
|
@@ -31,7 +31,7 @@ export declare function asyncAttemptRun<Yielded, Returned>(generator: () => Asyn
|
|
|
31
31
|
* @param signal Optional abort signal
|
|
32
32
|
* @returns Promised result
|
|
33
33
|
*/
|
|
34
|
-
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>>>;
|
|
35
35
|
/**
|
|
36
36
|
* Attempt to run the plan to completion
|
|
37
37
|
*
|
|
@@ -41,7 +41,7 @@ export declare function asyncAttemptRun<Yielded, Returned, Parameters extends un
|
|
|
41
41
|
* @param signal Optional abort signal
|
|
42
42
|
* @returns Promised result
|
|
43
43
|
*/
|
|
44
|
-
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>>>;
|
|
45
45
|
/**
|
|
46
46
|
* Attempt to run the generator to completion
|
|
47
47
|
*
|
|
@@ -51,7 +51,7 @@ export declare function asyncAttemptRun<Yielded, Returned>(plan: AsyncPlan<Yield
|
|
|
51
51
|
* @param parameters Parameters for starting the run
|
|
52
52
|
* @returns Result
|
|
53
53
|
*/
|
|
54
|
-
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>>;
|
|
55
55
|
/**
|
|
56
56
|
* Attempt to run the plan to completion
|
|
57
57
|
*
|
|
@@ -61,7 +61,7 @@ export declare function attemptRun<Yielded, Returned, Parameters extends unknown
|
|
|
61
61
|
* @param parameters Parameters for starting the run
|
|
62
62
|
* @returns Result
|
|
63
63
|
*/
|
|
64
|
-
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>>;
|
|
65
65
|
export declare namespace attemptRun {
|
|
66
66
|
export var async: typeof asyncAttemptRun;
|
|
67
67
|
}
|
package/dist/plan/result.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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) {
|
package/dist/plan/run.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AsyncPlan, Plan,
|
|
1
|
+
import { AsyncPlan, Plan, PlannedReturned } from "../models/plan.model.mjs";
|
|
2
2
|
import { asyncAttemptRun, attemptRun } from "./result.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Run an asynchronous generator to completion
|
|
@@ -8,7 +8,7 @@ import { asyncAttemptRun, attemptRun } from "./result.mjs";
|
|
|
8
8
|
* @param signal Optional abort signal
|
|
9
9
|
* @returns Result
|
|
10
10
|
*/
|
|
11
|
-
export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, parameters: Parameters, signal?: AbortSignal): Promise<
|
|
11
|
+
export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => AsyncGenerator<Yielded, Returned>, parameters: Parameters, signal?: AbortSignal): Promise<PlannedReturned<Returned>>;
|
|
12
12
|
/**
|
|
13
13
|
* Run an asynchronous generator to completion
|
|
14
14
|
*
|
|
@@ -16,7 +16,7 @@ export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]
|
|
|
16
16
|
* @param signal Optional abort signal
|
|
17
17
|
* @returns Result
|
|
18
18
|
*/
|
|
19
|
-
export declare function asyncRun<Yielded, Returned>(generator: () => AsyncGenerator<Yielded, Returned>, signal?: AbortSignal): Promise<
|
|
19
|
+
export declare function asyncRun<Yielded, Returned>(generator: () => AsyncGenerator<Yielded, Returned>, signal?: AbortSignal): Promise<PlannedReturned<Returned>>;
|
|
20
20
|
/**
|
|
21
21
|
* Run an asynchronous plan to completion
|
|
22
22
|
*
|
|
@@ -25,7 +25,7 @@ export declare function asyncRun<Yielded, Returned>(generator: () => AsyncGenera
|
|
|
25
25
|
* @param signal Optional abort signal
|
|
26
26
|
* @returns Result
|
|
27
27
|
*/
|
|
28
|
-
export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, parameters: Parameters, signal?: AbortSignal): Promise<
|
|
28
|
+
export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]>(plan: AsyncPlan<Yielded, Returned, Parameters>, parameters: Parameters, signal?: AbortSignal): Promise<PlannedReturned<Returned>>;
|
|
29
29
|
/**
|
|
30
30
|
* Run an asynchronous plan to completion
|
|
31
31
|
*
|
|
@@ -33,7 +33,7 @@ export declare function asyncRun<Yielded, Returned, Parameters extends unknown[]
|
|
|
33
33
|
* @param signal Optional abort signal
|
|
34
34
|
* @returns Result
|
|
35
35
|
*/
|
|
36
|
-
export declare function asyncRun<Yielded, Returned>(plan: AsyncPlan<Yielded, Returned, []>, signal?: AbortSignal): Promise<
|
|
36
|
+
export declare function asyncRun<Yielded, Returned>(plan: AsyncPlan<Yielded, Returned, []>, signal?: AbortSignal): Promise<PlannedReturned<Returned>>;
|
|
37
37
|
/**
|
|
38
38
|
* Run a generator to completion
|
|
39
39
|
*
|
|
@@ -41,7 +41,7 @@ export declare function asyncRun<Yielded, Returned>(plan: AsyncPlan<Yielded, Ret
|
|
|
41
41
|
* @param parameters Parameters for starting the run
|
|
42
42
|
* @returns Result
|
|
43
43
|
*/
|
|
44
|
-
export declare function run<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>, ...parameters: Parameters):
|
|
44
|
+
export declare function run<Yielded, Returned, Parameters extends unknown[]>(generator: (...parameters: Parameters) => Generator<Yielded, Returned>, ...parameters: Parameters): PlannedReturned<Returned>;
|
|
45
45
|
/**
|
|
46
46
|
* Run a plan to completion
|
|
47
47
|
*
|
|
@@ -49,7 +49,7 @@ export declare function run<Yielded, Returned, Parameters extends unknown[]>(gen
|
|
|
49
49
|
* @param parameters Parameters for starting the run
|
|
50
50
|
* @returns Result
|
|
51
51
|
*/
|
|
52
|
-
export declare function run<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters):
|
|
52
|
+
export declare function run<Yielded, Returned, Parameters extends unknown[]>(plan: Plan<Yielded, Returned, Parameters>, ...parameters: Parameters): PlannedReturned<Returned>;
|
|
53
53
|
export declare namespace asyncRun {
|
|
54
54
|
export var attempt: typeof asyncAttemptRun;
|
|
55
55
|
}
|
package/dist/plan/run.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PLAN_MESSAGE_RUN_INPUT, PLAN_SYMBOL } from "../models/plan.model.mjs";
|
|
2
1
|
import { asyncGenerate, generate } from "../internal/plan/plan.generate.mjs";
|
|
2
|
+
import { PLAN_MESSAGE_RUN_INPUT, PLAN_SYMBOL } from "../models/plan.model.mjs";
|
|
3
3
|
import { isAsyncGeneratorFunction, isAsyncPlan, isGeneratorFunction, isPlan } from "./is.mjs";
|
|
4
4
|
import { asyncAttemptRun, attemptRun } from "./result.mjs";
|
|
5
5
|
// src/plan/run.ts
|
package/dist/plan/use.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getGenerator } from "../internal/plan/index.mjs";
|
|
1
2
|
import { isError, isOk } from "../internal/result/misc.mjs";
|
|
2
3
|
import { PLAN_MESSAGE_USE_NESTED_FN, PLAN_MESSAGE_USE_SYNC_ASYNC, PLAN_STEP_ASYNC, PLAN_STEP_SYNC, PLAN_SYMBOL } from "../models/plan.model.mjs";
|
|
3
|
-
import { getGenerator } from "../internal/plan/index.mjs";
|
|
4
4
|
import { isAsyncFailure, isAsyncGenerator, isAsyncGeneratorFunction, isAsyncPlan, isAsyncStep, isAsyncSuccess, isGenerator } from "./is.mjs";
|
|
5
5
|
import { fail } from "./misc.mjs";
|
|
6
6
|
// src/plan/use.ts
|
|
@@ -19,7 +19,10 @@ function Step(generator) {
|
|
|
19
19
|
}
|
|
20
20
|
Step.prototype[Symbol.iterator] = getGenerator;
|
|
21
21
|
function asyncUse(value) {
|
|
22
|
-
return new AsyncStep(
|
|
22
|
+
return new AsyncStep(getAsyncUseStep(value));
|
|
23
|
+
}
|
|
24
|
+
function getAsyncUseStep(value) {
|
|
25
|
+
return async function* () {
|
|
23
26
|
let actual = value;
|
|
24
27
|
if (typeof actual === "function") actual = actual();
|
|
25
28
|
actual = await actual;
|
|
@@ -36,11 +39,10 @@ function asyncUse(value) {
|
|
|
36
39
|
return;
|
|
37
40
|
}
|
|
38
41
|
return actual;
|
|
39
|
-
}
|
|
42
|
+
};
|
|
40
43
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
return new Step(function* () {
|
|
44
|
+
function getUseStep(value) {
|
|
45
|
+
return function* () {
|
|
44
46
|
let actual = value;
|
|
45
47
|
if (typeof actual === "function") {
|
|
46
48
|
actual = actual();
|
|
@@ -58,7 +60,11 @@ function use(value) {
|
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
60
62
|
return actual;
|
|
61
|
-
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function use(value) {
|
|
66
|
+
validateUseInput(value, false);
|
|
67
|
+
return new Step(getUseStep(value));
|
|
62
68
|
}
|
|
63
69
|
function validateUseInput(value, resolved) {
|
|
64
70
|
if (value instanceof Promise || isAsyncFailure(value) || isAsyncGenerator(value) || isAsyncGeneratorFunction(value) || isAsyncPlan(value) || isAsyncStep(value) || isAsyncSuccess(value)) throw new Error(PLAN_MESSAGE_USE_SYNC_ASYNC);
|
package/dist/promise/delay.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAborter } from "../internal/aborter.mjs";
|
|
2
|
-
import { LIMITER_WAIT } from "../models/function/limiter.model.mjs";
|
|
3
2
|
import { getLimiter } from "../internal/function/limit.mjs";
|
|
3
|
+
import { LIMITER_WAIT } from "../models/function/limiter.model.mjs";
|
|
4
4
|
import { createPromiseOptions } from "./helpers.mjs";
|
|
5
5
|
import { settlePromise } from "./misc.mjs";
|
|
6
6
|
// src/promise/delay.ts
|
package/dist/promise/helpers.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getNumberOrDefault } from "../internal/defaults.mjs";
|
|
1
2
|
import { isPlainObject } from "../internal/is.mjs";
|
|
2
3
|
import { error, ok } from "../internal/result/misc.mjs";
|
|
3
|
-
import { getNumberOrDefault } from "../internal/defaults.mjs";
|
|
4
4
|
import { PROMISE_STRATEGY_ALL, PROMISE_STRATEGY_DEFAULT, PROMISE_TYPE_FULFILLED, PROMISE_TYPE_REJECTED } from "../models/promise.model.mjs";
|
|
5
5
|
// src/promise/helpers.ts
|
|
6
6
|
function createPromiseOptions(input) {
|
package/dist/promise/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isArrayOrPlainObject } from "../internal/is.mjs";
|
|
2
1
|
import { createAborter } from "../internal/aborter.mjs";
|
|
2
|
+
import { isArrayOrPlainObject } from "../internal/is.mjs";
|
|
3
3
|
import { asyncAttempt } from "../internal/result/attempt.mjs";
|
|
4
4
|
import { PROMISE_MESSAGE_EXPECTATION_ATTEMPT, PROMISE_MESSAGE_EXPECTATION_ITEMS_TYPE, PROMISE_STRATEGY_DEFAULT, PROMISE_TYPE_FULFILLED, PROMISE_TYPE_REJECTED } from "../models/promise.model.mjs";
|
|
5
5
|
import { createPromiseOptions, createPromisesOptions, getResultsFromPromises } from "./helpers.mjs";
|
|
@@ -15,13 +15,13 @@ async function attemptPromise(value, options) {
|
|
|
15
15
|
rejector(signal?.reason);
|
|
16
16
|
});
|
|
17
17
|
async function handler(resolve, reject) {
|
|
18
|
-
const
|
|
18
|
+
const attempted = await asyncAttempt(async () => {
|
|
19
19
|
let result = isFunction ? value() : await value;
|
|
20
20
|
if (result instanceof Promise) result = await result;
|
|
21
21
|
return result;
|
|
22
22
|
});
|
|
23
|
-
if (
|
|
24
|
-
else settlePromise(reject,
|
|
23
|
+
if (attempted.ok) settlePromise(resolve, attempted.value, aborter);
|
|
24
|
+
else settlePromise(reject, attempted.error, aborter);
|
|
25
25
|
}
|
|
26
26
|
let rejector;
|
|
27
27
|
const promise = new Promise((resolve, reject) => {
|
package/dist/promise/misc.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Aborter } from "../models/aborter.model.mjs";
|
|
2
|
-
import { Result } from "../models/result.model.mjs";
|
|
3
2
|
import { CancelablePromise, PromiseParameters } from "../models/promise.model.mjs";
|
|
3
|
+
import { Result } from "../models/result.model.mjs";
|
|
4
4
|
import { toPromise } from "../result/misc.mjs";
|
|
5
5
|
import { isFulfilled, isRejected } from "./helpers.mjs";
|
|
6
6
|
/**
|
package/dist/promise/misc.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { error, ok } from "../internal/result/misc.mjs";
|
|
2
|
-
import { toPromise } from "../result/misc.mjs";
|
|
3
2
|
import { CancelablePromise, PROMISE_MESSAGE_EXPECTATION_RESULT } from "../models/promise.model.mjs";
|
|
3
|
+
import { toPromise } from "../result/misc.mjs";
|
|
4
4
|
import { isFulfilled, isRejected } from "./helpers.mjs";
|
|
5
5
|
// src/promise/misc.ts
|
|
6
6
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CancelablePromise, FulfilledPromise, PromiseOptions, PromiseStrategy,
|
|
2
|
-
export { CancelablePromise, type FulfilledPromise, type PromiseOptions, type PromiseStrategy,
|
|
1
|
+
import { CancelablePromise, FulfilledPromise, PromiseOptions, PromiseStrategy, PromisesOptions, RejectedPromise, TimedError } from "../models/promise.model.mjs";
|
|
2
|
+
export { CancelablePromise, type FulfilledPromise, type PromiseOptions, type PromiseStrategy, type PromisesOptions, type RejectedPromise, TimedError };
|
package/dist/promise/models.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CancelablePromise,
|
|
1
|
+
export { CancelablePromise, TimedError } from "../models/promise.model.mjs";
|
package/dist/promise/timed.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAborter } from "../internal/aborter.mjs";
|
|
2
|
-
import { LIMITER_WAIT } from "../models/function/limiter.model.mjs";
|
|
3
2
|
import { getLimiter } from "../internal/function/limit.mjs";
|
|
4
|
-
import {
|
|
3
|
+
import { LIMITER_WAIT } from "../models/function/limiter.model.mjs";
|
|
4
|
+
import { PROMISE_MESSAGE_EXPECTATION_TIMED, TimedError } from "../models/promise.model.mjs";
|
|
5
5
|
import { createPromiseOptions } from "./helpers.mjs";
|
|
6
6
|
import { settlePromise } from "./misc.mjs";
|
|
7
7
|
// src/promise/timed.ts
|
|
@@ -13,7 +13,7 @@ async function getTimedPromise(promise, time, signal) {
|
|
|
13
13
|
limiter.cancel();
|
|
14
14
|
rejector(signal?.reason);
|
|
15
15
|
});
|
|
16
|
-
const limiter = getLimiter(LIMITER_WAIT, () => settlePromise(rejector, new
|
|
16
|
+
const limiter = getLimiter(LIMITER_WAIT, () => settlePromise(rejector, new TimedError(), aborter), time);
|
|
17
17
|
let rejector;
|
|
18
18
|
return Promise.race([promise, new Promise((_, reject) => {
|
|
19
19
|
rejector = reject;
|
package/dist/query.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPlainObject } from "./internal/is.mjs";
|
|
2
|
-
import { getString, ignoreKey, join, tryDecode, tryEncode } from "./internal/string/misc.mjs";
|
|
3
2
|
import { getNumber } from "./internal/number.mjs";
|
|
3
|
+
import { getString, ignoreKey, join, tryDecode, tryEncode } from "./internal/string/misc.mjs";
|
|
4
4
|
import { setValue } from "./internal/value/set.mjs";
|
|
5
5
|
import { QUERY_EXPRESSION_ARRAY_SUFFIX, QUERY_EXPRESSION_BOOLEAN, QUERY_TRUE, QUERY_TYPES } from "./models/query.model.mjs";
|
|
6
6
|
// src/query.ts
|
package/dist/queue.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { createAborter } from "./internal/aborter.mjs";
|
|
2
|
+
import { getBooleanOrDefault, getNumberOrDefault } from "./internal/defaults.mjs";
|
|
2
3
|
import { min } from "./internal/math/aggregate.mjs";
|
|
3
4
|
import { asyncAttempt } from "./internal/result/attempt.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { 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 } from "./models/queue.model.mjs";
|
|
5
|
+
import { 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 } from "./models/queue.model.mjs";
|
|
6
6
|
// src/queue.ts
|
|
7
7
|
function KeyedQueue(callback, options) {
|
|
8
8
|
this[QUEUE_SYMBOL] = {
|
|
9
9
|
callback,
|
|
10
10
|
options: createQueueOptions(options),
|
|
11
|
-
queues: /* @__PURE__ */ new Map()
|
|
11
|
+
queues: /* @__PURE__ */ new Map(),
|
|
12
|
+
type: QUEUE_NAME_KEYED
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
|
-
KeyedQueue.prototype[QUEUE_PROPERTY] = QUEUE_NAME_KEYED;
|
|
15
15
|
KeyedQueue.prototype.add = addKeyedQueue;
|
|
16
16
|
KeyedQueue.prototype.clear = clearQueues;
|
|
17
17
|
KeyedQueue.prototype.get = getQueue;
|
|
@@ -69,10 +69,10 @@ function Queue(callback, options, key) {
|
|
|
69
69
|
id: 0,
|
|
70
70
|
items: [],
|
|
71
71
|
paused: !options.autostart,
|
|
72
|
-
runners: 0
|
|
72
|
+
runners: 0,
|
|
73
|
+
type: QUEUE_NAME_QUEUE
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
|
-
Queue.prototype[QUEUE_PROPERTY] = QUEUE_NAME_QUEUE;
|
|
76
76
|
Queue.prototype.add = addToQueue;
|
|
77
77
|
Queue.prototype.clear = clearQueue;
|
|
78
78
|
Queue.prototype.pause = pauseQueue;
|
|
@@ -229,9 +229,9 @@ function getQueueSize() {
|
|
|
229
229
|
}
|
|
230
230
|
function getStatus(state, status) {
|
|
231
231
|
const queues = state.queues.entries();
|
|
232
|
-
const
|
|
233
|
-
for (const [key, queue] of queues) if (queue[status])
|
|
234
|
-
return
|
|
232
|
+
const queued = [];
|
|
233
|
+
for (const [key, queue] of queues) if (queue[status]) queued.push(key);
|
|
234
|
+
return queued;
|
|
235
235
|
}
|
|
236
236
|
function handleQueuedResult(item, error, result) {
|
|
237
237
|
item.aborter?.cancel();
|
|
@@ -276,7 +276,7 @@ function isQueue(value) {
|
|
|
276
276
|
return isQueueInstance(QUEUE_NAME_QUEUE, value);
|
|
277
277
|
}
|
|
278
278
|
function isQueueInstance(name, value) {
|
|
279
|
-
return typeof value === "object" && value != null &&
|
|
279
|
+
return typeof value === "object" && value != null && QUEUE_SYMBOL in value && value[QUEUE_SYMBOL].type === name;
|
|
280
280
|
}
|
|
281
281
|
function keyedQueue(callback, options) {
|
|
282
282
|
if (typeof callback !== "function") throw new TypeError(QUEUE_MESSAGE_CALLBACK);
|
package/dist/random.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getRandom, getRandomFloatingNumber, getRandomInteger } from "./internal/random.mjs";
|
|
2
1
|
import { shuffle } from "./internal/array/shuffle.mjs";
|
|
2
|
+
import { getRandom, getRandomFloatingNumber, getRandomInteger } from "./internal/random.mjs";
|
|
3
3
|
import { join } from "./internal/string/misc.mjs";
|
|
4
4
|
import { RANDOM_ALPHABET, RANDOM_BOOLEAN_MODIFIER, RANDOM_HEX_CHARACTERS } from "./models/random.model.mjs";
|
|
5
5
|
// src/random.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unwrapWork } from "../../internal/function/misc.mjs";
|
|
2
|
-
import { asyncAttempt, attempt } from "../../internal/result/attempt.mjs";
|
|
3
2
|
import { asyncFlow, flow } from "../../internal/function/work.mjs";
|
|
3
|
+
import { asyncAttempt, attempt } from "../../internal/result/attempt.mjs";
|
|
4
4
|
// src/result/work/flow.ts
|
|
5
5
|
function attemptAsyncFlow(...fns) {
|
|
6
6
|
let Flow;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { asyncPipe, pipe } from "../../internal/function/work.mjs";
|
|
1
2
|
import { isError, isOk } from "../../internal/result/misc.mjs";
|
|
2
3
|
import { asyncAttempt, attempt } from "../../internal/result/attempt.mjs";
|
|
3
|
-
import { asyncPipe, pipe } from "../../internal/function/work.mjs";
|
|
4
4
|
// src/result/work/pipe.ts
|
|
5
5
|
async function attemptAsyncPipe(initial, first, ...seconds) {
|
|
6
6
|
return asyncAttempt(async () => {
|
package/dist/sized/set.d.mts
CHANGED
|
@@ -9,6 +9,9 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
|
|
|
9
9
|
* Is the _Set_ full?
|
|
10
10
|
*/
|
|
11
11
|
get full(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The maximum size of the _Set_
|
|
14
|
+
*/
|
|
12
15
|
get maximum(): number;
|
|
13
16
|
/**
|
|
14
17
|
* Create a new _SizedSet_ with values and a maximum size _(2^20)_
|
package/dist/sized/set.mjs
CHANGED
package/dist/string/fuzzy.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { isPlainObject } from "../internal/is.mjs";
|
|
2
|
-
import { floor } from "../internal/math/misc.mjs";
|
|
3
2
|
import { max } from "../internal/math/aggregate.mjs";
|
|
4
|
-
import {
|
|
3
|
+
import { floor } from "../internal/math/misc.mjs";
|
|
5
4
|
import { lowerCase } from "../internal/string/case.mjs";
|
|
6
|
-
import {
|
|
5
|
+
import { getString } from "../internal/string/misc.mjs";
|
|
6
|
+
import { FUZZY_BOUNDARY_SEPARATOR, FUZZY_MESSAGE_ARRAY, FUZZY_MESSAGE_HANDLER, FUZZY_SYMBOL } from "../models/string/string.fuzzy.model.mjs";
|
|
7
7
|
// src/string/fuzzy.ts
|
|
8
8
|
function Fuzzy(state) {
|
|
9
9
|
this[FUZZY_SYMBOL] = state;
|
|
10
10
|
}
|
|
11
|
-
Fuzzy.prototype[FUZZY_PROPERTY] = true;
|
|
12
11
|
Fuzzy.prototype.search = search;
|
|
13
12
|
Object.defineProperties(Fuzzy.prototype, {
|
|
14
13
|
items: {
|
|
@@ -216,7 +215,7 @@ function isBoundary(string, index) {
|
|
|
216
215
|
* @returns `true` if the value is a fuzzy searcher, otherwise `false`
|
|
217
216
|
*/
|
|
218
217
|
function isFuzzy(value) {
|
|
219
|
-
return typeof value === "object" && value !== null &&
|
|
218
|
+
return typeof value === "object" && value !== null && FUZZY_SYMBOL in value;
|
|
220
219
|
}
|
|
221
220
|
function search(input, option) {
|
|
222
221
|
const state = this[FUZZY_SYMBOL];
|
package/dist/string/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isTemplateStringsArray } from "../internal/is.mjs";
|
|
2
2
|
import { min } from "../internal/math/aggregate.mjs";
|
|
3
|
-
import { STRING_EXPRESSION_WHITESPACE_PREFIX } from "../models/string/string.misc.model.mjs";
|
|
4
3
|
import { getString, interpolate, join, words } from "../internal/string/misc.mjs";
|
|
5
4
|
import { EXPRESSION_NUMERICAL_PREFIX } from "../models/misc.model.mjs";
|
|
5
|
+
import { STRING_EXPRESSION_WHITESPACE_PREFIX } from "../models/string/string.misc.model.mjs";
|
|
6
6
|
// src/string/index.ts
|
|
7
7
|
function dedent(value, ...values) {
|
|
8
8
|
let actual;
|
package/dist/string/match.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { STRING_MATCH_ENDS_WITH, STRING_MATCH_INCLUDES, STRING_MATCH_STARTS_WITH } from "../models/string/string.misc.model.mjs";
|
|
2
1
|
import { memoize } from "../internal/function/memoize.mjs";
|
|
2
|
+
import { STRING_MATCH_ENDS_WITH, STRING_MATCH_INCLUDES, STRING_MATCH_STARTS_WITH } from "../models/string/string.misc.model.mjs";
|
|
3
3
|
// src/string/match.ts
|
|
4
4
|
/**
|
|
5
5
|
* Check if a string ends with a specified substring
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isPlainObject } from "../internal/is.mjs";
|
|
2
|
-
import { EXPRESSION_WHITESPACE_MULTIPLE } from "../models/misc.model.mjs";
|
|
3
1
|
import { memoize } from "../internal/function/memoize.mjs";
|
|
2
|
+
import { isPlainObject } from "../internal/is.mjs";
|
|
4
3
|
import { lowerCase } from "../internal/string/case.mjs";
|
|
4
|
+
import { EXPRESSION_WHITESPACE_MULTIPLE } from "../models/misc.model.mjs";
|
|
5
5
|
import { NORMALIZE_DEBURR_CHARACTERS, NORMALIZE_DEBURR_PATTERN_CHARACTERS, NORMALIZE_DEBURR_PATTERN_SIMPLE, NORMALIZE_SPECIAL_PATTERN, NORMALIZE_SYMBOL } from "../models/string/string.normalize.model.mjs";
|
|
6
6
|
// src/string/normalize.ts
|
|
7
7
|
function Normalizer(options) {
|
package/dist/subscription.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Subscription, SubscriptionParameters, SubscriptionProperty, Subscriptions, SubscriptionsParameters } from "./models/subscription.model.mjs";
|
|
2
1
|
import { isSubscription, isSubscriptions, subscriptions } from "./internal/subscription.mjs";
|
|
3
|
-
|
|
2
|
+
import { Subscription, SubscriptionParameters, Subscriptions, SubscriptionsParameters } from "./models/subscription.model.mjs";
|
|
3
|
+
export { type Subscription, type SubscriptionParameters, type Subscriptions, type SubscriptionsParameters, isSubscription, isSubscriptions, subscriptions };
|
package/dist/value/clone.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Constructor } from "../models/index.mjs";
|
|
2
|
-
import { ValueHandler } from "../models/value/value.handler.model.mjs";
|
|
3
2
|
import { CloneOptions, Cloner } from "../models/value/value.clone.model.mjs";
|
|
3
|
+
import { ValueHandler } from "../models/value/value.handler.model.mjs";
|
|
4
4
|
declare function Cloner(this: any, options: Required<CloneOptions>): void;
|
|
5
5
|
/**
|
|
6
6
|
* Clone any kind of value _(deeply, if needed)_
|
package/dist/value/clone.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isArrayOrPlainObject, isTypedArray } from "../internal/is.mjs";
|
|
2
|
-
import { unwrap } from "../internal/result/misc.mjs";
|
|
3
2
|
import { attempt } from "../internal/result/attempt.mjs";
|
|
3
|
+
import { unwrap } from "../internal/result/misc.mjs";
|
|
4
4
|
import { createValueHandler } from "../internal/value/handlers.mjs";
|
|
5
5
|
import { CLONE_COPY_OPTIONS, CLONE_DEFAULT_OPTIONS, CLONE_NAME, CLONE_PRIMITIVES, CLONE_SYMBOL } from "../models/value/value.clone.model.mjs";
|
|
6
6
|
// src/value/clone.ts
|
package/dist/value/freeze.mjs
CHANGED
package/dist/value/handle.mjs
CHANGED