@oscarpalmer/atoms 0.221.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 +1 -268
- package/dist/index.mjs +166 -331
- 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 +1 -2
- 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 +1 -3
- package/dist/internal/string/case.mjs +1 -2
- 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 +1 -2
- 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 +1 -3
- package/dist/models/string/string.case.model.mjs +1 -2
- 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 +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 +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/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>;
|
package/dist/value/omit.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { partial } from "../internal/value/partial.mjs";
|
|
2
|
-
|
|
2
|
+
// src/value/omit.ts
|
|
3
3
|
/**
|
|
4
4
|
* Create a new object without the specified keys
|
|
5
5
|
*
|
|
@@ -10,5 +10,4 @@ import { partial } from "../internal/value/partial.mjs";
|
|
|
10
10
|
function omit(value, keys) {
|
|
11
11
|
return partial(value, keys, true);
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { omit };
|
package/dist/value/pick.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
|
-
//#region src/value/pick.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Create a new object with only the specified keys
|
|
5
4
|
*
|
|
@@ -7,5 +6,4 @@ import { PlainObject } from "../models/index.mjs";
|
|
|
7
6
|
* @param keys Keys to use
|
|
8
7
|
* @returns Partial object with only the specified keys
|
|
9
8
|
*/
|
|
10
|
-
export declare function pick<Value extends PlainObject, ValueKey extends keyof Value>(value: Value, keys: ValueKey[]): Pick<Value, ValueKey>;
|
|
11
|
-
//#endregion
|
|
9
|
+
export declare function pick<Value extends PlainObject, ValueKey extends keyof Value>(value: Value, keys: ValueKey[]): Pick<Value, ValueKey>;
|
package/dist/value/pick.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { partial } from "../internal/value/partial.mjs";
|
|
2
|
-
|
|
2
|
+
// src/value/pick.ts
|
|
3
3
|
/**
|
|
4
4
|
* Create a new object with only the specified keys
|
|
5
5
|
*
|
|
@@ -10,5 +10,4 @@ import { partial } from "../internal/value/partial.mjs";
|
|
|
10
10
|
function pick(value, keys) {
|
|
11
11
|
return partial(value, keys, false);
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { pick };
|
package/dist/value/shake.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
2
|
import { Shaken } from "../models/value/value.misc.model.mjs";
|
|
3
|
-
//#region src/value/shake.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Shake an object, removing all keys with `undefined` values
|
|
6
5
|
*
|
|
@@ -8,5 +7,4 @@ import { Shaken } from "../models/value/value.misc.model.mjs";
|
|
|
8
7
|
* @returns Shaken object
|
|
9
8
|
*/
|
|
10
9
|
export declare function shake<Value extends PlainObject>(value: Value): Shaken<Value>;
|
|
11
|
-
//#endregion
|
|
12
10
|
export type { Shaken };
|
package/dist/value/shake.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNonPlainObject } from "../internal/is.mjs";
|
|
2
|
-
|
|
2
|
+
// src/value/shake.ts
|
|
3
3
|
/**
|
|
4
4
|
* Shake an object, removing all keys with `undefined` values
|
|
5
5
|
*
|
|
@@ -18,5 +18,4 @@ function shake(value) {
|
|
|
18
18
|
}
|
|
19
19
|
return shaken;
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { shake };
|
package/dist/value/smush.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
2
|
import { Smushed } from "../models/value/value.misc.model.mjs";
|
|
3
|
-
//#region src/value/smush.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Smush an object into a flat object that uses dot notation keys
|
|
6
5
|
*
|
|
@@ -8,5 +7,4 @@ import { Smushed } from "../models/value/value.misc.model.mjs";
|
|
|
8
7
|
* @returns Smushed object with dot notation keys
|
|
9
8
|
*/
|
|
10
9
|
export declare function smush<Value extends PlainObject>(value: Value): Smushed<Value>;
|
|
11
|
-
//#endregion
|
|
12
10
|
export type { Smushed };
|
package/dist/value/smush.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isArrayOrPlainObject } from "../internal/is.mjs";
|
|
2
2
|
import "../models/value/value.misc.model.mjs";
|
|
3
3
|
import { join } from "../internal/string/misc.mjs";
|
|
4
|
-
|
|
4
|
+
// src/value/smush.ts
|
|
5
5
|
function flattenObject(value, depth, smushed, prefix) {
|
|
6
6
|
if (depth >= 100) return {};
|
|
7
7
|
if (smushed.has(value)) return smushed.get(value);
|
|
@@ -35,5 +35,4 @@ function flattenObject(value, depth, smushed, prefix) {
|
|
|
35
35
|
function smush(value) {
|
|
36
36
|
return typeof value === "object" && value !== null ? flattenObject(value, 0, /* @__PURE__ */ new WeakMap()) : {};
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { smush };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
2
|
import { TransformCallback, TransformCallbacks, TransformHandler } from "../models/value/value.transform.model.mjs";
|
|
3
|
-
//#region src/value/transform.d.ts
|
|
4
3
|
declare function Transformer(this: any, transformer: ReturnType<typeof getTransformHandler>): void;
|
|
5
4
|
declare function getTransformHandler<Value extends PlainObject, Key extends keyof Value>(input: unknown): TransformHandler<Value> | undefined;
|
|
6
5
|
/**
|
|
@@ -40,5 +39,4 @@ export declare function transform<Value extends PlainObject>(value: Value, trans
|
|
|
40
39
|
export declare namespace transform {
|
|
41
40
|
export var initialize: typeof initializeTransformer;
|
|
42
41
|
}
|
|
43
|
-
//#endregion
|
|
44
42
|
export type { TransformCallback, TransformCallbacks, Transformer };
|
package/dist/value/transform.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNonPlainObject } from "../internal/is.mjs";
|
|
2
2
|
import { TRANSFORM_SYMBOL } from "../models/value/value.transform.model.mjs";
|
|
3
|
-
|
|
3
|
+
// src/value/transform.ts
|
|
4
4
|
function Transformer(transformer) {
|
|
5
5
|
this[TRANSFORM_SYMBOL] = transformer;
|
|
6
6
|
}
|
|
@@ -39,5 +39,4 @@ function transformValue(value) {
|
|
|
39
39
|
return value;
|
|
40
40
|
}
|
|
41
41
|
transform.initialize = initializeTransformer;
|
|
42
|
-
//#endregion
|
|
43
42
|
export { initializeTransformer, transform };
|
package/dist/value/unsmush.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PlainObject } from "../models/index.mjs";
|
|
2
2
|
import { Unsmushed } from "../models/value/value.misc.model.mjs";
|
|
3
|
-
//#region src/value/unsmush.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Unsmush a smushed object _(turning dot notation keys into nested keys)_
|
|
6
5
|
*
|
|
@@ -8,5 +7,4 @@ import { Unsmushed } from "../models/value/value.misc.model.mjs";
|
|
|
8
7
|
* @returns Unsmushed object with nested keys
|
|
9
8
|
*/
|
|
10
9
|
export declare function unsmush<Value extends PlainObject>(value: Value): Unsmushed<Value>;
|
|
11
|
-
//#endregion
|
|
12
10
|
export type { Unsmushed };
|
package/dist/value/unsmush.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isArrayOrPlainObject } from "../internal/is.mjs";
|
|
2
2
|
import { setValue } from "../internal/value/set.mjs";
|
|
3
|
-
|
|
3
|
+
// src/value/unsmush.ts
|
|
4
4
|
function getKeys(value) {
|
|
5
5
|
const keys = Object.keys(value);
|
|
6
6
|
const { length } = keys;
|
|
@@ -34,5 +34,4 @@ function unsmush(value) {
|
|
|
34
34
|
}
|
|
35
35
|
return unsmushed;
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { unsmush };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oscarpalmer/atoms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.222.0",
|
|
4
4
|
"description": "Atomic utilities for making your JavaScript better.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
"jsdom": "^30.1",
|
|
323
323
|
"tsdown": "^0.23",
|
|
324
324
|
"typescript": "^7",
|
|
325
|
-
"vite-plus": "^1.
|
|
325
|
+
"vite-plus": "^1.4"
|
|
326
326
|
},
|
|
327
327
|
"packageManager": "npm@11.11.1"
|
|
328
328
|
}
|