@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/promise/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
2
|
import { PromiseOptions, PromiseStrategy, PromisesItems, PromisesOptions, PromisesResult, PromisesUnwrapped, PromisesValues } from "../models/promise.model.mjs";
|
|
3
|
-
//#region src/promise/index.d.ts
|
|
4
3
|
type AttemptPromiseOptions = PromiseOptions | AbortSignal | number;
|
|
5
4
|
/**
|
|
6
5
|
* Wrap a _Promise_ with safety handlers
|
|
@@ -107,5 +106,4 @@ export declare function resultPromises<Items extends PlainObject>(items: Items,
|
|
|
107
106
|
export declare namespace promises {
|
|
108
107
|
export var result: typeof resultPromises;
|
|
109
108
|
}
|
|
110
|
-
//#endregion
|
|
111
109
|
export {};
|
package/dist/promise/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { PROMISE_MESSAGE_EXPECTATION_ATTEMPT, PROMISE_MESSAGE_EXPECTATION_ITEMS_
|
|
|
5
5
|
import { createPromiseOptions, createPromisesOptions, getResultsFromPromises } from "./helpers.mjs";
|
|
6
6
|
import { handleResult, settlePromise } from "./misc.mjs";
|
|
7
7
|
import { getTimedPromise } from "./timed.mjs";
|
|
8
|
-
|
|
8
|
+
// src/promise/index.ts
|
|
9
9
|
async function attemptPromise(value, options) {
|
|
10
10
|
const isFunction = typeof value === "function";
|
|
11
11
|
if (!isFunction && !(value instanceof Promise)) throw new TypeError(PROMISE_MESSAGE_EXPECTATION_ATTEMPT);
|
|
@@ -75,5 +75,4 @@ async function resultPromises(items, signal) {
|
|
|
75
75
|
return promises(items, signal).then(getResultsFromPromises);
|
|
76
76
|
}
|
|
77
77
|
promises.result = resultPromises;
|
|
78
|
-
//#endregion
|
|
79
78
|
export { attemptPromise, promises, resultPromises };
|
package/dist/promise/misc.d.mts
CHANGED
|
@@ -3,7 +3,6 @@ import { Result } from "../models/result.model.mjs";
|
|
|
3
3
|
import { CancelablePromise, PromiseParameters } from "../models/promise.model.mjs";
|
|
4
4
|
import { toPromise } from "../result/misc.mjs";
|
|
5
5
|
import { isFulfilled, isRejected } from "./helpers.mjs";
|
|
6
|
-
//#region src/promise/misc.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Create a cancelable _Promise_
|
|
9
8
|
*
|
|
@@ -33,5 +32,4 @@ export declare function toResult<Value>(callback: () => Promise<Value>): Promise
|
|
|
33
32
|
* @returns Promised result
|
|
34
33
|
*/
|
|
35
34
|
export declare function toResult<Value>(promise: Promise<Value>): Promise<Result<Value>>;
|
|
36
|
-
//#endregion
|
|
37
35
|
export { toPromise as fromResult, isFulfilled, isRejected };
|
package/dist/promise/misc.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { error, ok } from "../internal/result/misc.mjs";
|
|
|
2
2
|
import { toPromise } from "../result/misc.mjs";
|
|
3
3
|
import { CancelablePromise, PROMISE_MESSAGE_EXPECTATION_RESULT } from "../models/promise.model.mjs";
|
|
4
4
|
import { isFulfilled, isRejected } from "./helpers.mjs";
|
|
5
|
-
|
|
5
|
+
// src/promise/misc.ts
|
|
6
6
|
/**
|
|
7
7
|
* Create a cancelable _Promise_
|
|
8
8
|
*
|
|
@@ -50,5 +50,4 @@ async function toResult(value) {
|
|
|
50
50
|
if (!(actual instanceof Promise)) throw new TypeError(PROMISE_MESSAGE_EXPECTATION_RESULT);
|
|
51
51
|
return actual.then((result) => ok(result)).catch((reason) => error(reason));
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
53
|
export { cancelable, toPromise as fromResult, handleResult, isFulfilled, isRejected, settlePromise, toResult };
|
package/dist/promise/timed.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RequiredKeys } from "../models/index.mjs";
|
|
2
2
|
import { PromiseOptions } from "../models/promise.model.mjs";
|
|
3
|
-
//#region src/promise/timed.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* @internal
|
|
6
5
|
*/
|
|
@@ -20,5 +19,4 @@ export declare function timed<Value>(promise: Promise<Value>, options: RequiredK
|
|
|
20
19
|
* @param time How long to wait for _(in milliseconds; defaults to `0`)_
|
|
21
20
|
* @returns Timed _Promise_
|
|
22
21
|
*/
|
|
23
|
-
export declare function timed<Value>(promise: Promise<Value>, time: number): Promise<Value>;
|
|
24
|
-
//#endregion
|
|
22
|
+
export declare function timed<Value>(promise: Promise<Value>, time: number): Promise<Value>;
|
package/dist/promise/timed.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { getLimiter } from "../internal/function/limit.mjs";
|
|
|
4
4
|
import { PROMISE_MESSAGE_EXPECTATION_TIMED, PromiseTimeoutError } 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
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
@@ -31,5 +31,4 @@ async function timed(promise, options) {
|
|
|
31
31
|
if (signal?.aborted ?? false) throw signal?.reason;
|
|
32
32
|
return time > 0 ? getTimedPromise(promise, time, signal) : promise;
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { getTimedPromise, timed };
|
package/dist/query.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlainObject } from "./models/index.mjs";
|
|
2
|
-
//#region src/query.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Convert a query string to a plain _(nested)_ object
|
|
5
4
|
*
|
|
@@ -13,5 +12,4 @@ export declare function fromQuery(query: string): PlainObject;
|
|
|
13
12
|
* @param parameters Plain object to convert
|
|
14
13
|
* @returns Query string representation of the object
|
|
15
14
|
*/
|
|
16
|
-
export declare function toQuery(parameters: PlainObject): string;
|
|
17
|
-
//#endregion
|
|
15
|
+
export declare function toQuery(parameters: PlainObject): string;
|
package/dist/query.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { getString, ignoreKey, join, tryDecode, tryEncode } from "./internal/str
|
|
|
3
3
|
import { getNumber } from "./internal/number.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
|
|
7
7
|
/**
|
|
8
8
|
* Convert a query string to a plain _(nested)_ object
|
|
9
9
|
*
|
|
@@ -73,5 +73,4 @@ function isDecodable(value) {
|
|
|
73
73
|
function toQuery(parameters) {
|
|
74
74
|
return isPlainObject(parameters) ? join(getParts(parameters, false).filter((part) => part.length > 0), "&") : "";
|
|
75
75
|
}
|
|
76
|
-
//#endregion
|
|
77
76
|
export { fromQuery, toQuery };
|
package/dist/queue.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenericAsyncCallback, GenericCallback } from "./models/index.mjs";
|
|
2
2
|
import { KeyedQueue, Queue, QueueOptions, Queued } from "./models/queue.model.mjs";
|
|
3
|
-
//#region src/queue.d.ts
|
|
4
3
|
declare function KeyedQueue(this: any, callback: GenericAsyncCallback, options: Required<QueueOptions>): void;
|
|
5
4
|
declare function Queue(this: any, callback: GenericAsyncCallback, options: Required<QueueOptions>, key?: string): void;
|
|
6
5
|
/**
|
|
@@ -54,5 +53,4 @@ export declare function queue<Callback extends GenericCallback>(callback: Callba
|
|
|
54
53
|
export declare namespace queue {
|
|
55
54
|
export var keyed: typeof keyedQueue;
|
|
56
55
|
}
|
|
57
|
-
//#endregion
|
|
58
56
|
export type { KeyedQueue, Queue, QueueOptions, Queued };
|
package/dist/queue.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { min } from "./internal/math/aggregate.mjs";
|
|
|
3
3
|
import { asyncAttempt } from "./internal/result/attempt.mjs";
|
|
4
4
|
import { getBooleanOrDefault, getNumberOrDefault } from "./internal/defaults.mjs";
|
|
5
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";
|
|
6
|
-
|
|
6
|
+
// src/queue.ts
|
|
7
7
|
function KeyedQueue(callback, options) {
|
|
8
8
|
this[QUEUE_SYMBOL] = {
|
|
9
9
|
callback,
|
|
@@ -359,5 +359,4 @@ async function run(state) {
|
|
|
359
359
|
state.runners -= 1;
|
|
360
360
|
}
|
|
361
361
|
queue.keyed = keyedQueue;
|
|
362
|
-
//#endregion
|
|
363
362
|
export { isKeyedQueue, isQueue, keyedQueue, queue };
|
package/dist/random.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getRandom, getRandomFloatingNumber, getRandomInteger } from "./internal/random.mjs";
|
|
2
|
-
//#region src/random.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Get a random boolean
|
|
5
4
|
*
|
|
@@ -49,5 +48,4 @@ export declare function getRandomItems<Value>(array: Value[], amount: number): V
|
|
|
49
48
|
* @returns Shuffled version of the original array
|
|
50
49
|
*/
|
|
51
50
|
export declare function getRandomItems<Value>(array: Value[]): Value[];
|
|
52
|
-
//#endregion
|
|
53
51
|
export { getRandom, getRandomFloatingNumber as getRandomFloat, getRandomInteger };
|
package/dist/random.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { getRandom, getRandomFloatingNumber, getRandomInteger } from "./internal
|
|
|
2
2
|
import { shuffle } from "./internal/array/shuffle.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
|
|
6
6
|
/**
|
|
7
7
|
* Get a random boolean
|
|
8
8
|
*
|
|
@@ -58,5 +58,4 @@ function getRandomItems(array, amount) {
|
|
|
58
58
|
if (amount === 1) return [array[getRandomInteger(0, array.length - 1)]];
|
|
59
59
|
return typeof amount !== "number" || amount <= 0 || amount >= array.length ? shuffle(array) : shuffle(array).slice(0, amount);
|
|
60
60
|
}
|
|
61
|
-
//#endregion
|
|
62
61
|
export { getRandom, getRandomBoolean, getRandomCharacters, getRandomColor, getRandomFloatingNumber as getRandomFloat, getRandomHex, getRandomInteger, getRandomItem, getRandomItems };
|
package/dist/result/match.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AnyResult, ResultMatch } from "../models/result.model.mjs";
|
|
2
|
-
//#region src/result/match.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Handles a _Result_ with match callbacks
|
|
5
4
|
*
|
|
@@ -40,5 +39,4 @@ export declare function matchResult<Value, Returned, E = Error>(result: AnyResul
|
|
|
40
39
|
export declare function matchResult<Value, Returned, E = Error>(result: AnyResult<Value, E> | (() => AnyResult<Value, E>), ok: ResultMatch<Value, Returned, E>["ok"], error: ResultMatch<Value, Returned, E>["error"]): Returned;
|
|
41
40
|
export declare namespace matchResult {
|
|
42
41
|
export var async: typeof asyncMatchResult;
|
|
43
|
-
}
|
|
44
|
-
//#endregion
|
|
42
|
+
}
|
package/dist/result/match.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPlainObject } from "../internal/is.mjs";
|
|
2
2
|
import { isOk, isResult } from "../internal/result/misc.mjs";
|
|
3
|
-
|
|
3
|
+
// src/result/match.ts
|
|
4
4
|
async function asyncMatchResult(result, first, second) {
|
|
5
5
|
let value;
|
|
6
6
|
if (typeof result === "function") value = await result();
|
|
@@ -35,5 +35,4 @@ const MATCH_MESSAGE_ERROR = "`result.match` expected an Error callback";
|
|
|
35
35
|
const MATCH_MESSAGE_OK = "`result.match` expected an Ok callback";
|
|
36
36
|
const MATCH_MESSAGE_RESULT = "`result.match` expected a Result or a function that returns a Result";
|
|
37
37
|
matchResult.async = asyncMatchResult;
|
|
38
|
-
//#endregion
|
|
39
38
|
export { asyncMatchResult, matchResult };
|
package/dist/result/misc.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AnyResult } from "../models/result.model.mjs";
|
|
2
2
|
import { error, isError, isOk, isResult, ok, unwrap } from "../internal/result/misc.mjs";
|
|
3
|
-
//#region src/result/misc.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Converts a result to a _Promise_
|
|
6
5
|
*
|
|
@@ -19,5 +18,4 @@ export declare function toPromise<Value, E = Error>(callback: () => AnyResult<Va
|
|
|
19
18
|
* @returns Promised result
|
|
20
19
|
*/
|
|
21
20
|
export declare function toPromise<Value, E = Error>(result: AnyResult<Value, E>): Promise<Value>;
|
|
22
|
-
//#endregion
|
|
23
21
|
export { error, isError, isOk, isResult, ok, unwrap };
|
package/dist/result/misc.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { error, isError, isOk, isResult, ok, unwrap } from "../internal/result/misc.mjs";
|
|
2
|
-
|
|
2
|
+
// src/result/misc.ts
|
|
3
3
|
async function toPromise(result) {
|
|
4
4
|
const actual = typeof result === "function" ? result() : result;
|
|
5
5
|
if (!isResult(actual)) throw new TypeError(RESULT_MESSAGE_PROMISE);
|
|
@@ -7,5 +7,4 @@ async function toPromise(result) {
|
|
|
7
7
|
throw actual.error;
|
|
8
8
|
}
|
|
9
9
|
const RESULT_MESSAGE_PROMISE = "toPromise expected to receive a Result";
|
|
10
|
-
//#endregion
|
|
11
10
|
export { error, isError, isOk, isResult, ok, toPromise, unwrap };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenericCallback } from "../../models/index.mjs";
|
|
2
2
|
import { AttemptAsyncFlow, AttemptFlow, Result, UnwrapValue } from "../../models/result.model.mjs";
|
|
3
|
-
//#region src/result/work/flow.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Create an asynchronous _Flow_, a function that attempts to pipe a value through a series of functions
|
|
6
5
|
*
|
|
@@ -171,5 +170,4 @@ export declare function attemptFlow<First extends GenericCallback>(first: First,
|
|
|
171
170
|
export declare function attemptFlow(...fns: GenericCallback[]): (...args: unknown[]) => Result<unknown>;
|
|
172
171
|
export declare namespace attemptFlow {
|
|
173
172
|
export var async: typeof attemptAsyncFlow;
|
|
174
|
-
}
|
|
175
|
-
//#endregion
|
|
173
|
+
}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unwrapWork } from "../../internal/function/misc.mjs";
|
|
2
2
|
import { asyncAttempt, attempt } from "../../internal/result/attempt.mjs";
|
|
3
3
|
import { asyncFlow, flow } from "../../internal/function/work.mjs";
|
|
4
|
-
|
|
4
|
+
// src/result/work/flow.ts
|
|
5
5
|
function attemptAsyncFlow(...fns) {
|
|
6
6
|
let Flow;
|
|
7
7
|
return (...args) => asyncAttempt(() => {
|
|
8
8
|
Flow ??= asyncFlow(...fns);
|
|
9
|
-
return Flow(...args.map(
|
|
10
|
-
if (isError(value)) throw value.error;
|
|
11
|
-
return isOk(value) ? value.value : value;
|
|
12
|
-
}));
|
|
9
|
+
return Flow(...args.map(unwrapWork));
|
|
13
10
|
});
|
|
14
11
|
}
|
|
15
12
|
function attemptFlow(...fns) {
|
|
16
13
|
let Flow;
|
|
17
14
|
return (...args) => attempt(() => {
|
|
18
15
|
Flow ??= flow(...fns);
|
|
19
|
-
return Flow(...args.map(
|
|
20
|
-
if (isError(value)) throw value.error;
|
|
21
|
-
return isOk(value) ? value.value : value;
|
|
22
|
-
}));
|
|
16
|
+
return Flow(...args.map(unwrapWork));
|
|
23
17
|
});
|
|
24
18
|
}
|
|
25
19
|
attemptFlow.async = attemptAsyncFlow;
|
|
26
|
-
//#endregion
|
|
27
20
|
export { attemptAsyncFlow, attemptFlow };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenericCallback } from "../../models/index.mjs";
|
|
2
2
|
import { Result, UnwrapValue } from "../../models/result.model.mjs";
|
|
3
|
-
//#region src/result/work/pipe.d.ts
|
|
4
3
|
type InitialAsyncPipeValue<Initial> = GenericCallback | Initial | Promise<Initial> | Result<Initial>;
|
|
5
4
|
type InitialPipeValue<Initial> = GenericCallback | Initial | Result<Initial>;
|
|
6
5
|
type WrapValue<Value> = Result<UnwrapValue<Value>>;
|
|
@@ -183,5 +182,4 @@ export declare function attemptPipe<Initial>(initial: InitialPipeValue<Initial>,
|
|
|
183
182
|
export declare namespace attemptPipe {
|
|
184
183
|
export var async: typeof attemptAsyncPipe;
|
|
185
184
|
}
|
|
186
|
-
//#endregion
|
|
187
185
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isError, isOk } from "../../internal/result/misc.mjs";
|
|
2
2
|
import { asyncAttempt, attempt } from "../../internal/result/attempt.mjs";
|
|
3
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 () => {
|
|
7
7
|
if (isError(initial)) throw initial.error;
|
|
@@ -23,5 +23,4 @@ function attemptPipe(initial, first, ...seconds) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
attemptPipe.async = attemptAsyncPipe;
|
|
26
|
-
//#endregion
|
|
27
26
|
export { attemptAsyncPipe, attemptPipe };
|
package/dist/sized/set.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/sized/set.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A _Set_ with a maximum size
|
|
4
3
|
*
|
|
@@ -45,5 +44,4 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
|
|
|
45
44
|
* @returns Found value if it exists, otherwise `undefined`
|
|
46
45
|
*/
|
|
47
46
|
get(value: Value, update?: boolean): Value | undefined;
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
47
|
+
}
|
package/dist/sized/set.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSizedMaximum } from "../internal/sized/misc.mjs";
|
|
2
|
-
|
|
2
|
+
// src/sized/set.ts
|
|
3
3
|
/**
|
|
4
4
|
* A _Set_ with a maximum size
|
|
5
5
|
*
|
|
@@ -53,5 +53,4 @@ var SizedSet = class extends Set {
|
|
|
53
53
|
return value;
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
//#endregion
|
|
57
56
|
export { SizedSet };
|
package/dist/string/fuzzy.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
2
|
import { Fuzzy, FuzzyConfiguration, FuzzyOptions, FuzzyResult, FuzzyState, InternalFuzzy } from "../models/string/string.fuzzy.model.mjs";
|
|
3
|
-
//#region src/string/fuzzy.d.ts
|
|
4
3
|
declare function Fuzzy(this: InternalFuzzy, state: FuzzyState<unknown>): void;
|
|
5
4
|
/**
|
|
6
5
|
* Create a fuzzy searcher for an array of items
|
|
@@ -49,5 +48,4 @@ export declare namespace fuzzy {
|
|
|
49
48
|
export var is: typeof isFuzzy;
|
|
50
49
|
export var match: typeof fuzzyMatch;
|
|
51
50
|
}
|
|
52
|
-
//#endregion
|
|
53
51
|
export type { Fuzzy, FuzzyOptions, FuzzyResult };
|
package/dist/string/fuzzy.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { max } from "../internal/math/aggregate.mjs";
|
|
|
4
4
|
import { getString } from "../internal/string/misc.mjs";
|
|
5
5
|
import { lowerCase } from "../internal/string/case.mjs";
|
|
6
6
|
import { FUZZY_BOUNDARY_SEPARATOR, FUZZY_MESSAGE_ARRAY, FUZZY_MESSAGE_HANDLER, FUZZY_PROPERTY, 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
|
}
|
|
@@ -262,5 +262,4 @@ function setItems(value) {
|
|
|
262
262
|
let defaultSorter;
|
|
263
263
|
fuzzy.is = isFuzzy;
|
|
264
264
|
fuzzy.match = fuzzyMatch;
|
|
265
|
-
//#endregion
|
|
266
265
|
export { fuzzy, fuzzyMatch, isFuzzy };
|
package/dist/string/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getString, join, words } from "../internal/string/misc.mjs";
|
|
2
|
-
//#region src/string/index.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Dedent a string template, removing common leading whitespace from each line
|
|
5
4
|
*
|
|
@@ -64,5 +63,4 @@ export declare function trim(value: string): string;
|
|
|
64
63
|
* ```
|
|
65
64
|
*/
|
|
66
65
|
export declare function truncate(value: string, length: number, suffix?: string): string;
|
|
67
|
-
//#endregion
|
|
68
66
|
export { getString, join, words };
|
package/dist/string/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { min } from "../internal/math/aggregate.mjs";
|
|
|
3
3
|
import { STRING_EXPRESSION_WHITESPACE_PREFIX } from "../models/string/string.misc.model.mjs";
|
|
4
4
|
import { getString, interpolate, join, words } from "../internal/string/misc.mjs";
|
|
5
5
|
import { EXPRESSION_NUMERICAL_PREFIX } from "../models/misc.model.mjs";
|
|
6
|
-
|
|
6
|
+
// src/string/index.ts
|
|
7
7
|
function dedent(value, ...values) {
|
|
8
8
|
let actual;
|
|
9
9
|
if (isTemplateStringsArray(value)) actual = interpolate(value, values);
|
|
@@ -106,5 +106,4 @@ function truncate(value, length, suffix) {
|
|
|
106
106
|
const truncatedLength = length - actualSuffixLength;
|
|
107
107
|
return `${value.slice(0, truncatedLength)}${actualSuffix}`;
|
|
108
108
|
}
|
|
109
|
-
//#endregion
|
|
110
109
|
export { dedent, getString, getUuid, join, parse, trim, truncate, words };
|
package/dist/string/match.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/string/match.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Check if a string ends with a specified substring
|
|
4
3
|
*
|
|
@@ -49,5 +48,4 @@ export declare function includes(haystack: string, needle: string, ignoreCase?:
|
|
|
49
48
|
* startsWith('this is a test', 'not'); // => false
|
|
50
49
|
* ```
|
|
51
50
|
*/
|
|
52
|
-
export declare function startsWith(haystack: string, needle: string, ignoreCase?: boolean): boolean;
|
|
53
|
-
//#endregion
|
|
51
|
+
export declare function startsWith(haystack: string, needle: string, ignoreCase?: boolean): boolean;
|
package/dist/string/match.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { STRING_MATCH_ENDS_WITH, STRING_MATCH_INCLUDES, STRING_MATCH_STARTS_WITH } from "../models/string/string.misc.model.mjs";
|
|
2
2
|
import { memoize } from "../internal/function/memoize.mjs";
|
|
3
|
-
|
|
3
|
+
// src/string/match.ts
|
|
4
4
|
/**
|
|
5
5
|
* Check if a string ends with a specified substring
|
|
6
6
|
*
|
|
@@ -67,5 +67,4 @@ function startsWith(haystack, needle, ignoreCase) {
|
|
|
67
67
|
return match(STRING_MATCH_STARTS_WITH, haystack, needle, ignoreCase === true);
|
|
68
68
|
}
|
|
69
69
|
const matchMemoizers = {};
|
|
70
|
-
//#endregion
|
|
71
70
|
export { endsWith, includes, startsWith };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { NormalizeOptions, Normalizer, NormalizerOptions } from "../models/string/string.normalize.model.mjs";
|
|
2
|
-
//#region src/string/normalize.d.ts
|
|
3
2
|
declare function Normalizer(this: any, options: NormalizerOptions): void;
|
|
4
3
|
/**
|
|
5
4
|
* Deburr a string, removing diacritical marks
|
|
@@ -30,5 +29,4 @@ export declare function normalize(value: string, options?: NormalizeOptions): st
|
|
|
30
29
|
export declare namespace normalize {
|
|
31
30
|
export var initialize: typeof initializeNormalizer;
|
|
32
31
|
}
|
|
33
|
-
//#endregion
|
|
34
32
|
export type { NormalizeOptions, Normalizer };
|
|
@@ -3,7 +3,7 @@ import { EXPRESSION_WHITESPACE_MULTIPLE } from "../models/misc.model.mjs";
|
|
|
3
3
|
import { memoize } from "../internal/function/memoize.mjs";
|
|
4
4
|
import { lowerCase } from "../internal/string/case.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) {
|
|
8
8
|
this[NORMALIZE_SYMBOL] = options;
|
|
9
9
|
}
|
|
@@ -69,5 +69,4 @@ function normalizeString(value) {
|
|
|
69
69
|
}
|
|
70
70
|
let deburrMemoizer;
|
|
71
71
|
normalize.initialize = initializeNormalizer;
|
|
72
|
-
//#endregion
|
|
73
72
|
export { deburr, initializeNormalizer, normalize };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
2
|
import { Renderer, TemplateOptions, Templater, TemplaterOptions, TemplaterRenderer } from "../models/string/string.template.model.mjs";
|
|
3
|
-
//#region src/string/template.d.ts
|
|
4
3
|
declare function Templater(this: any, options: TemplaterOptions): void;
|
|
5
4
|
/**
|
|
6
5
|
* Create a _Templater_ with predefined options
|
|
@@ -33,5 +32,4 @@ export declare function template(value: string, variables?: PlainObject, options
|
|
|
33
32
|
export declare namespace template {
|
|
34
33
|
export var initialize: typeof initializeTemplater;
|
|
35
34
|
}
|
|
36
|
-
//#endregion
|
|
37
35
|
export type { Renderer, TemplateOptions, Templater, TemplaterOptions, TemplaterRenderer };
|
package/dist/string/template.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { isPlainObject, isTemplateStringsArray } from "../internal/is.mjs";
|
|
|
2
2
|
import { getString, interpolate } from "../internal/string/misc.mjs";
|
|
3
3
|
import { getValue } from "../internal/value/get.mjs";
|
|
4
4
|
import { TEMPLATE_EXPRESSION_VARIABLE, TEMPLATE_SYMBOL } from "../models/string/string.template.model.mjs";
|
|
5
|
-
|
|
5
|
+
// src/string/template.ts
|
|
6
6
|
function Templater(options) {
|
|
7
7
|
this[TEMPLATE_SYMBOL] = options;
|
|
8
8
|
}
|
|
@@ -53,5 +53,4 @@ function template(value, ...parameters) {
|
|
|
53
53
|
return handleTemplate(value, pattern, ignoreCase, parameters[0]);
|
|
54
54
|
}
|
|
55
55
|
template.initialize = initializeTemplater;
|
|
56
|
-
//#endregion
|
|
57
56
|
export { initializeTemplater, template };
|
package/dist/value/clone.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Constructor } from "../models/index.mjs";
|
|
2
2
|
import { ValueHandler } from "../models/value/value.handler.model.mjs";
|
|
3
3
|
import { CloneOptions, Cloner } from "../models/value/value.clone.model.mjs";
|
|
4
|
-
//#region src/value/clone.d.ts
|
|
5
4
|
declare function Cloner(this: any, options: Required<CloneOptions>): void;
|
|
6
5
|
/**
|
|
7
6
|
* Clone any kind of value _(deeply, if needed)_
|
|
@@ -53,5 +52,4 @@ export declare namespace clone {
|
|
|
53
52
|
export var initialize: typeof initializeCloner;
|
|
54
53
|
export var register: typeof registerCloner;
|
|
55
54
|
}
|
|
56
|
-
//#endregion
|
|
57
55
|
export type { CloneOptions, Cloner };
|
package/dist/value/clone.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { unwrap } from "../internal/result/misc.mjs";
|
|
|
3
3
|
import { attempt } from "../internal/result/attempt.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
|
|
7
7
|
function Cloner(options) {
|
|
8
8
|
this[CLONE_SYMBOL] = options;
|
|
9
9
|
}
|
|
@@ -168,5 +168,4 @@ clone.deregister = deregisterCloner;
|
|
|
168
168
|
clone.handlers = cloneHandler;
|
|
169
169
|
clone.initialize = initializeCloner;
|
|
170
170
|
clone.register = registerCloner;
|
|
171
|
-
//#endregion
|
|
172
171
|
export { clone, copy, deregisterCloner, initializeCloner, registerCloner };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/value/collection.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Does the value exist for a key in a _Map_?
|
|
4
3
|
*
|
|
@@ -23,5 +22,4 @@ export declare function inMap<Key, Value>(map: Map<Key, Value>, value: Value, ke
|
|
|
23
22
|
* @param value Value to check for
|
|
24
23
|
* @returns `true` if the value exists, otherwise `false`
|
|
25
24
|
*/
|
|
26
|
-
export declare function inSet<Value>(set: Set<Value>, value: Value): boolean;
|
|
27
|
-
//#endregion
|
|
25
|
+
export declare function inSet<Value>(set: Set<Value>, value: Value): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPrimitive } from "../internal/is.mjs";
|
|
2
2
|
import { equal } from "../internal/value/equal.mjs";
|
|
3
|
-
|
|
3
|
+
// src/value/collection.ts
|
|
4
4
|
function inMap(map, value, key) {
|
|
5
5
|
const getKey = key === true;
|
|
6
6
|
if (!(map instanceof Map)) return getKey ? void 0 : false;
|
|
@@ -23,5 +23,4 @@ function inSet(set, value) {
|
|
|
23
23
|
for (const item of set) if (equal(item, value)) return true;
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { inMap, inSet };
|
package/dist/value/diff.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DiffOptions, DiffResult } from "../models/value/value.diff.model.mjs";
|
|
2
|
-
//#region src/value/diff.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Find the differences between two values
|
|
5
4
|
*
|
|
@@ -9,5 +8,4 @@ import { DiffOptions, DiffResult } from "../models/value/value.diff.model.mjs";
|
|
|
9
8
|
* @returns Difference result
|
|
10
9
|
*/
|
|
11
10
|
export declare function diff<First, Second = First>(first: First, second: Second, options?: DiffOptions): DiffResult<First, Second>;
|
|
12
|
-
//#endregion
|
|
13
11
|
export type { DiffOptions, DiffResult };
|
package/dist/value/diff.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { max, min } from "../internal/math/aggregate.mjs";
|
|
|
3
3
|
import { join } from "../internal/string/misc.mjs";
|
|
4
4
|
import { equal } from "../internal/value/equal.mjs";
|
|
5
5
|
import { DIFF_FULL, DIFF_NONE, DIFF_PARTIAL } from "../models/value/value.diff.model.mjs";
|
|
6
|
-
|
|
6
|
+
// src/value/diff.ts
|
|
7
7
|
/**
|
|
8
8
|
* Find the differences between two values
|
|
9
9
|
*
|
|
@@ -102,5 +102,4 @@ function setChanges(parameters) {
|
|
|
102
102
|
const diffsLength = diffs.length;
|
|
103
103
|
for (let diffIndex = 0; diffIndex < diffsLength; diffIndex += 1) changes.push(diffs[diffIndex]);
|
|
104
104
|
}
|
|
105
|
-
//#endregion
|
|
106
105
|
export { diff };
|
package/dist/value/freeze.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Frozen, PlainObject } from "../models/index.mjs";
|
|
2
|
-
//#region src/value/freeze.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Freeze an array and its indiced values, but not any nested values
|
|
5
4
|
*
|
|
@@ -136,5 +135,4 @@ export declare function isFrozen(value: unknown): boolean;
|
|
|
136
135
|
export declare namespace freeze {
|
|
137
136
|
export var flat: typeof flatFreeze;
|
|
138
137
|
export var is: typeof isFrozen;
|
|
139
|
-
}
|
|
140
|
-
//#endregion
|
|
138
|
+
}
|
package/dist/value/freeze.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { noop } from "../internal/function/misc.mjs";
|
|
2
1
|
import { isPlainObject } from "../internal/is.mjs";
|
|
3
|
-
|
|
2
|
+
import { noop } from "../internal/function/misc.mjs";
|
|
3
|
+
// src/value/freeze.ts
|
|
4
4
|
function fakeDelete() {
|
|
5
5
|
return false;
|
|
6
6
|
}
|
|
@@ -78,5 +78,4 @@ function isFrozen(value) {
|
|
|
78
78
|
const frozenValues = /* @__PURE__ */ new WeakSet();
|
|
79
79
|
freeze.flat = flatFreeze;
|
|
80
80
|
freeze.is = isFrozen;
|
|
81
|
-
//#endregion
|
|
82
81
|
export { flatFreeze, freeze, isFrozen };
|
package/dist/value/merge.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ArrayOrPlainObject, PlainObject, UnionToIntersection } from "../models/index.mjs";
|
|
2
2
|
import { AssignOptions, Assigner, MergeOptions, Merger, MergingOptions } from "../models/value/value.merge.model.mjs";
|
|
3
|
-
//#region src/value/merge.d.ts
|
|
4
3
|
declare function Assigner(this: any, options: MergingOptions): void;
|
|
5
4
|
declare function Merger(this: any, options: MergingOptions): void;
|
|
6
5
|
/**
|
|
@@ -44,5 +43,4 @@ export declare namespace assign {
|
|
|
44
43
|
export declare namespace merge {
|
|
45
44
|
export var initialize: typeof initializeMerger;
|
|
46
45
|
}
|
|
47
|
-
//#endregion
|
|
48
46
|
export type { AssignOptions, Assigner, MergeOptions, Merger };
|
package/dist/value/merge.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isArrayOrPlainObject } from "../internal/is.mjs";
|
|
2
2
|
import { MERGE_SYMBOL_ASSIGN, MERGE_SYMBOL_MERGE } from "../models/value/value.merge.model.mjs";
|
|
3
|
-
|
|
3
|
+
// src/value/merge.ts
|
|
4
4
|
function Assigner(options) {
|
|
5
5
|
this[MERGE_SYMBOL_ASSIGN] = {
|
|
6
6
|
...options,
|
|
@@ -127,5 +127,4 @@ function skipMerge(next, options, isArray) {
|
|
|
127
127
|
}
|
|
128
128
|
assign.initialize = initializeAssigner;
|
|
129
129
|
merge.initialize = initializeMerger;
|
|
130
|
-
//#endregion
|
|
131
130
|
export { assign, initializeAssigner, initializeMerger, merge };
|
package/dist/value/omit.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
|
-
//#region src/value/omit.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Create a new object without the specified keys
|
|
5
4
|
*
|
|
@@ -7,5 +6,4 @@ import { PlainObject } from "../models/index.mjs";
|
|
|
7
6
|
* @param keys Keys to omit
|
|
8
7
|
* @returns Partial object without the specified keys
|
|
9
8
|
*/
|
|
10
|
-
export declare function omit<Value extends PlainObject, ValueKey extends keyof Value>(value: Value, keys: ValueKey[]): Omit<Value, ValueKey>;
|
|
11
|
-
//#endregion
|
|
9
|
+
export declare function omit<Value extends PlainObject, ValueKey extends keyof Value>(value: Value, keys: ValueKey[]): Omit<Value, ValueKey>;
|