ts-data-forge 6.2.1 → 6.2.2
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/README.md +35 -6
- package/dist/array/impl/array-utils-reducing-value.d.mts +4 -1
- package/dist/array/impl/array-utils-reducing-value.d.mts.map +1 -1
- package/dist/array/impl/array-utils-reducing-value.mjs.map +1 -1
- package/dist/array/impl/array-utils-search.d.mts +3 -1
- package/dist/array/impl/array-utils-search.d.mts.map +1 -1
- package/dist/array/impl/array-utils-search.mjs.map +1 -1
- package/dist/array/impl/array-utils-transformation.d.mts +12 -5
- package/dist/array/impl/array-utils-transformation.d.mts.map +1 -1
- package/dist/array/impl/array-utils-transformation.mjs.map +1 -1
- package/dist/collections/imap.d.mts +4 -1
- package/dist/collections/imap.d.mts.map +1 -1
- package/dist/collections/imap.mjs.map +1 -1
- package/dist/collections/iset-mapped.d.mts +2 -1
- package/dist/collections/iset-mapped.d.mts.map +1 -1
- package/dist/collections/iset-mapped.mjs.map +1 -1
- package/dist/collections/iset.d.mts +3 -1
- package/dist/collections/iset.d.mts.map +1 -1
- package/dist/collections/iset.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-expect-to-be.d.mts +3 -1
- package/dist/functional/optional/impl/optional-expect-to-be.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-expect-to-be.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-flat-map.d.mts +4 -1
- package/dist/functional/optional/impl/optional-flat-map.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-flat-map.mjs.map +1 -1
- package/dist/functional/optional/impl/optional-is-none.d.mts +1 -1
- package/dist/functional/optional/impl/optional-is-none.mjs +1 -1
- package/dist/functional/optional/impl/optional-or-else.d.mts +4 -1
- package/dist/functional/optional/impl/optional-or-else.d.mts.map +1 -1
- package/dist/functional/optional/impl/optional-or-else.mjs.map +1 -1
- package/dist/functional/result/impl/result-from-promise.d.mts +3 -1
- package/dist/functional/result/impl/result-from-promise.d.mts.map +1 -1
- package/dist/functional/result/impl/result-from-promise.mjs +3 -1
- package/dist/functional/result/impl/result-from-promise.mjs.map +1 -1
- package/dist/functional/result/impl/result-map-err.d.mts +3 -1
- package/dist/functional/result/impl/result-map-err.d.mts.map +1 -1
- package/dist/functional/result/impl/result-map-err.mjs.map +1 -1
- package/dist/functional/result/impl/result-or-else.d.mts +4 -1
- package/dist/functional/result/impl/result-or-else.d.mts.map +1 -1
- package/dist/functional/result/impl/result-or-else.mjs.map +1 -1
- package/dist/functional/result/impl/result-unwrap-throw.d.mts +1 -1
- package/dist/functional/result/impl/result-unwrap-throw.mjs +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts +4 -1
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-expect-to-be.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts +4 -1
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-flat-map.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts +4 -5
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs +4 -5
- package/dist/functional/ternary-result/impl/ternary-result-is-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts +4 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-map-warn.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts +4 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs +4 -1
- package/dist/functional/ternary-result/impl/ternary-result-to-optional.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts +4 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-unwrap-err-or.mjs.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts +4 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.d.mts.map +1 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.mjs +4 -1
- package/dist/functional/ternary-result/impl/ternary-result-zip.mjs.map +1 -1
- package/dist/guard/is-record.d.mts +1 -1
- package/dist/guard/is-record.mjs +1 -1
- package/dist/json/json.d.mts +4 -2
- package/dist/json/json.d.mts.map +1 -1
- package/dist/json/json.mjs +4 -2
- package/dist/json/json.mjs.map +1 -1
- package/package.json +15 -11
- package/src/array/impl/array-utils-reducing-value.mts +4 -1
- package/src/array/impl/array-utils-search.mts +3 -1
- package/src/array/impl/array-utils-transformation.mts +12 -5
- package/src/collections/imap.mts +4 -1
- package/src/collections/iset-mapped.mts +2 -1
- package/src/collections/iset.mts +3 -1
- package/src/collections/queue.test.mts +295 -1
- package/src/functional/optional/impl/optional-expect-to-be.mts +3 -1
- package/src/functional/optional/impl/optional-flat-map.mts +4 -1
- package/src/functional/optional/impl/optional-is-none.mts +1 -1
- package/src/functional/optional/impl/optional-or-else.mts +4 -1
- package/src/functional/result/impl/result-from-promise.mts +3 -1
- package/src/functional/result/impl/result-map-err.mts +3 -1
- package/src/functional/result/impl/result-or-else.mts +4 -1
- package/src/functional/result/impl/result-unwrap-throw.mts +1 -1
- package/src/functional/ternary-result/impl/ternary-result-expect-to-be.mts +4 -1
- package/src/functional/ternary-result/impl/ternary-result-flat-map.mts +4 -1
- package/src/functional/ternary-result/impl/ternary-result-is-warn.mts +4 -5
- package/src/functional/ternary-result/impl/ternary-result-map-warn.mts +4 -1
- package/src/functional/ternary-result/impl/ternary-result-to-optional.mts +4 -1
- package/src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts +4 -1
- package/src/functional/ternary-result/impl/ternary-result-zip.mts +4 -1
- package/src/guard/is-record.mts +1 -1
- package/src/json/json.mts +4 -2
|
@@ -15,7 +15,9 @@ type UnwrapPromise<P extends Promise<unknown>> = P extends Promise<infer V> ? V
|
|
|
15
15
|
* ```ts
|
|
16
16
|
* const successPromise = Result.fromPromise(Promise.resolve('ok'));
|
|
17
17
|
*
|
|
18
|
-
* const failurePromise = Result.fromPromise(
|
|
18
|
+
* const failurePromise = Result.fromPromise(
|
|
19
|
+
* Promise.reject(new Error('fail')),
|
|
20
|
+
* );
|
|
19
21
|
*
|
|
20
22
|
* const resolved = await successPromise;
|
|
21
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-from-promise.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-from-promise.mts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,KAAK,aAAa,CAAC,CAAC,SAAS,OAAO,CAAC,OAAO,CAAC,IAC3C,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"result-from-promise.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-from-promise.mts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,KAAK,aAAa,CAAC,CAAC,SAAS,OAAO,CAAC,OAAO,CAAC,IAC3C,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,OAAO,CAAC,OAAO,CAAC,EACpD,SAAS,CAAC,KACT,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAEmB,CAAC"}
|
|
@@ -12,7 +12,9 @@ import { ok } from './result-ok.mjs';
|
|
|
12
12
|
* ```ts
|
|
13
13
|
* const successPromise = Result.fromPromise(Promise.resolve('ok'));
|
|
14
14
|
*
|
|
15
|
-
* const failurePromise = Result.fromPromise(
|
|
15
|
+
* const failurePromise = Result.fromPromise(
|
|
16
|
+
* Promise.reject(new Error('fail')),
|
|
17
|
+
* );
|
|
16
18
|
*
|
|
17
19
|
* const resolved = await successPromise;
|
|
18
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-from-promise.mjs","sources":["../../../../src/functional/result/impl/result-from-promise.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAWA
|
|
1
|
+
{"version":3,"file":"result-from-promise.mjs","sources":["../../../../src/functional/result/impl/result-from-promise.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACI,MAAM,WAAW,GAAG,CACzB,OAAU;AAEV;AACA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAyB,CAAC,CAAC,KAAK,CAAC,GAAG;;;;"}
|
|
@@ -12,7 +12,9 @@ import { type UnwrapErr, type UnwrapOk } from './types.mjs';
|
|
|
12
12
|
*
|
|
13
13
|
* const untouchedOk = Result.mapErr(okValue, (error) => error.toUpperCase());
|
|
14
14
|
*
|
|
15
|
-
* const uppercasedErr = Result.mapErr(errValue, (error) =>
|
|
15
|
+
* const uppercasedErr = Result.mapErr(errValue, (error) =>
|
|
16
|
+
* error.toUpperCase(),
|
|
17
|
+
* );
|
|
16
18
|
*
|
|
17
19
|
* assert.deepStrictEqual(untouchedOk, Result.ok(3));
|
|
18
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-map-err.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-map-err.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D
|
|
1
|
+
{"version":3,"file":"result-map-err.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-map-err.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,aAAa,EAAE,EAAE,EAChD,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,GACjC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAG3B,wBAAgB,MAAM,CAAC,CAAC,EAAE,EAAE,EAC1B,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GACtB,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-map-err.mjs","sources":["../../../../src/functional/result/impl/result-map-err.mts"],"sourcesContent":[null],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"result-map-err.mjs","sources":["../../../../src/functional/result/impl/result-map-err.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAgDM,SAAU,MAAM,CACpB,GAAG,IAE8C,EAAA;AAEjD,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;;AAEN,YAAA,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,IAAI;AAE5B,YAAA,OAAO,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC;QAClC;QAEA,KAAK,CAAC,EAAE;;AAEN,YAAA,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI;YAEpB,OAAO,CAAC,MAAS,KAAK,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC;QACjD;;AAEJ;AAEA,MAAM,UAAU,GAAG,CACjB,MAAS,EACT,KAAkC,KAElC,IAAI,CAAC,MAAM;AACT;QACG;AACH;QACE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,KAAqB,CAAC,CAAC;;;;"}
|
|
@@ -22,7 +22,10 @@ import { type NarrowToOk } from './types.mjs';
|
|
|
22
22
|
* Result.ok('default'),
|
|
23
23
|
* );
|
|
24
24
|
*
|
|
25
|
-
* assert.deepStrictEqual(
|
|
25
|
+
* assert.deepStrictEqual(
|
|
26
|
+
* orElseFallback(Result.ok('value')),
|
|
27
|
+
* Result.ok('value'),
|
|
28
|
+
* );
|
|
26
29
|
* ```
|
|
27
30
|
*
|
|
28
31
|
* @template R The input `UnknownResult` type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-or-else.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-or-else.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C
|
|
1
|
+
{"version":3,"file":"result-or-else.d.mts","sourceRoot":"","sources":["../../../../src/functional/result/impl/result-or-else.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,aAAa,EAAE,EAAE,SAAS,aAAa,EACtE,MAAM,EAAE,CAAC,EACT,WAAW,EAAE,EAAE,GACd,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAGtB,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EACjC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAC1B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-or-else.mjs","sources":["../../../../src/functional/result/impl/result-or-else.mts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"result-or-else.mjs","sources":["../../../../src/functional/result/impl/result-or-else.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAgDM,SAAU,MAAM,CACpB,GAAG,IAAwE,EAAA;AAE3E,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;;AAEN,YAAA,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,IAAI;AAElC,YAAA,OAAO,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC;QACxC;QAEA,KAAK,CAAC,EAAE;;AAEN,YAAA,MAAM,CAAC,WAAW,CAAC,GAAG,IAAI;YAE1B,OAAO,CAAC,MAAS,KAAK,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC;QACvD;;AAEJ;AAEA,MAAM,UAAU,GAAG,CACjB,MAAS,EACT,WAAe,MACS,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,WAAW,CAAC;;;;"}
|
|
@@ -17,7 +17,7 @@ import { type UnwrapErr, type UnwrapOk } from './types.mjs';
|
|
|
17
17
|
*
|
|
18
18
|
* assert.isTrue(Result.unwrapThrow(okResult) === 'data');
|
|
19
19
|
*
|
|
20
|
-
* assert.throws(() => Result.unwrapThrow(errResult),
|
|
20
|
+
* assert.throws(() => Result.unwrapThrow(errResult), Error, 'fail');
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
23
23
|
* @template R The `UnknownResult` type to unwrap.
|
|
@@ -19,7 +19,7 @@ import { isErr } from './result-is-err.mjs';
|
|
|
19
19
|
*
|
|
20
20
|
* assert.isTrue(Result.unwrapThrow(okResult) === 'data');
|
|
21
21
|
*
|
|
22
|
-
* assert.throws(() => Result.unwrapThrow(errResult),
|
|
22
|
+
* assert.throws(() => Result.unwrapThrow(errResult), Error, 'fail');
|
|
23
23
|
* ```
|
|
24
24
|
*
|
|
25
25
|
* @template R The `UnknownResult` type to unwrap.
|
|
@@ -11,7 +11,10 @@ import { type UnwrapOk } from './types.mjs';
|
|
|
11
11
|
*
|
|
12
12
|
* const expectResult = TernaryResult.expectToBe<string>('needs value');
|
|
13
13
|
*
|
|
14
|
-
* assert.throws(
|
|
14
|
+
* assert.throws(
|
|
15
|
+
* () => expectResult(TernaryResult.err('oops')),
|
|
16
|
+
* /needs value/u,
|
|
17
|
+
* );
|
|
15
18
|
* ```
|
|
16
19
|
*/
|
|
17
20
|
export declare function expectToBe<R extends UnknownTernaryResult>(result: R, message: string): UnwrapOk<R>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-expect-to-be.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-expect-to-be.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"ternary-result-expect-to-be.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-expect-to-be.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,oBAAoB,EACvD,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,MAAM,GACd,QAAQ,CAAC,CAAC,CAAC,CAAC;AAGf,wBAAgB,UAAU,CAAC,CAAC,EAC1B,OAAO,EAAE,MAAM,GACd,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-expect-to-be.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-expect-to-be.mts"],"sourcesContent":[null],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ternary-result-expect-to-be.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-expect-to-be.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAgCM,SAAU,UAAU,CACxB,GAAG,IAAwE,EAAA;AAE3E,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;AAE9B,YAAA,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC;QACpC;QAEA,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI;YAEtB,OAAO,CAAC,MAAS,KAAK,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC;QACnD;;AAEJ;AAEA,MAAM,UAAU,GAAG,CACjB,MAAS,EACT,OAAe,KACA;AACf,IAAA,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE;AAChB,QAAA,OAAO,QAAQ,CAAC,MAAM,CAAC;IACzB;AAEA,IAAA,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAC1B,CAAC;;;;"}
|
|
@@ -19,7 +19,10 @@ import { type UnwrapErr, type UnwrapOk, type UnwrapWarn } from './types.mjs';
|
|
|
19
19
|
* parse,
|
|
20
20
|
* );
|
|
21
21
|
*
|
|
22
|
-
* const errPassthrough = TernaryResult.flatMap(
|
|
22
|
+
* const errPassthrough = TernaryResult.flatMap(
|
|
23
|
+
* TernaryResult.err('oops'),
|
|
24
|
+
* parse,
|
|
25
|
+
* );
|
|
23
26
|
*
|
|
24
27
|
* assert.deepStrictEqual(doubled, TernaryResult.ok(6));
|
|
25
28
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-flat-map.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-flat-map.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7E
|
|
1
|
+
{"version":3,"file":"ternary-result-flat-map.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-flat-map.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,oBAAoB,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAChE,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAC3D,aAAa,CAAC,EAAE,EAAE,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAG5D,wBAAgB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EACnC,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GACjD,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-flat-map.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-flat-map.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ternary-result-flat-map.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-flat-map.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;AA+CM,SAAU,OAAO,CACrB,GAAG,IAKwE,EAAA;AAI3E,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI;AAEhC,YAAA,OAAO,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC;QACvC;QAEA,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI;YAExB,OAAO,CAAC,MAAS,KAAK,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC;QACtD;;AAEJ;AAEA,MAAM,WAAW,GAAG,CAClB,MAAS,EACT,SAA4D,KACA;AAC5D,IAAA,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE;;AAEhB,QAAA,OAAO,SAAS,CAAC,MAAM,CAAC,KAAoB,CAAC;IAC/C;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE;QAClB,MAAM,IAAI,GAAG,SAAS;;QAEpB,MAAM,CAAC,KAAoB,CAC5B;AAED,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE;AACd,YAAA,OAAO,IAAI,CACT,IAAI,CAAC,KAAK;;YAEV,MAAM,CAAC,OAAwB,CAChC;QACH;AAEA,QAAA,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE;YAChB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAoC,CAAC;QACpE;AAEA,QAAA,OAAO,IAAI;IACb;;AAGA,IAAA,OAAO,MAAuC;AAChD,CAAC;;;;"}
|
|
@@ -5,11 +5,10 @@ import { type NarrowToWarn } from './types.mjs';
|
|
|
5
5
|
* @example
|
|
6
6
|
*
|
|
7
7
|
* ```ts
|
|
8
|
-
* const maybeWarn = TernaryResult.warn(
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* >;
|
|
8
|
+
* const maybeWarn = TernaryResult.warn(
|
|
9
|
+
* 'value',
|
|
10
|
+
* 'check logs',
|
|
11
|
+
* ) as TernaryResult<string, string, string>;
|
|
13
12
|
*
|
|
14
13
|
* if (TernaryResult.isWarn(maybeWarn)) {
|
|
15
14
|
* assert.strictEqual(maybeWarn.value, 'value');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-is-warn.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-is-warn.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD
|
|
1
|
+
{"version":3,"file":"ternary-result-is-warn.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-is-warn.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,oBAAoB,EACnD,QAAQ,CAAC,KACR,MAAM,IAAI,YAAY,CAAC,CAAC,CAAqC,CAAC"}
|
|
@@ -6,11 +6,10 @@ import { WarnTypeTagName } from './tag.mjs';
|
|
|
6
6
|
* @example
|
|
7
7
|
*
|
|
8
8
|
* ```ts
|
|
9
|
-
* const maybeWarn = TernaryResult.warn(
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* >;
|
|
9
|
+
* const maybeWarn = TernaryResult.warn(
|
|
10
|
+
* 'value',
|
|
11
|
+
* 'check logs',
|
|
12
|
+
* ) as TernaryResult<string, string, string>;
|
|
14
13
|
*
|
|
15
14
|
* if (TernaryResult.isWarn(maybeWarn)) {
|
|
16
15
|
* assert.strictEqual(maybeWarn.value, 'value');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-is-warn.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-is-warn.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA
|
|
1
|
+
{"version":3,"file":"ternary-result-is-warn.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-is-warn.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;;;;;;;;;;;;;;;;AAiBG;AACI,MAAM,MAAM,GAAG,CACpB,MAAS,KACqB,MAAM,CAAC,KAAK,KAAK;;;;"}
|
|
@@ -7,7 +7,10 @@ import { type UnwrapErr, type UnwrapOk, type UnwrapWarn } from './types.mjs';
|
|
|
7
7
|
* ```ts
|
|
8
8
|
* const warnValue = TernaryResult.warn(2, 'slow');
|
|
9
9
|
*
|
|
10
|
-
* const mappedWarn = TernaryResult.mapWarn(
|
|
10
|
+
* const mappedWarn = TernaryResult.mapWarn(
|
|
11
|
+
* warnValue,
|
|
12
|
+
* (warning) => `${warning}!`,
|
|
13
|
+
* );
|
|
11
14
|
*
|
|
12
15
|
* const okPassthrough = TernaryResult.mapWarn(
|
|
13
16
|
* TernaryResult.ok(3),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-map-warn.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-map-warn.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7E
|
|
1
|
+
{"version":3,"file":"ternary-result-map-warn.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-map-warn.mts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,oBAAoB,EAAE,EAAE,EACxD,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,GACpC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAGhD,wBAAgB,OAAO,CAAC,CAAC,EAAE,EAAE,EAC3B,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,GACxB,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-map-warn.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-map-warn.mts"],"sourcesContent":[null],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ternary-result-map-warn.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-map-warn.mts"],"sourcesContent":[null],"names":[],"mappings":";;;AAqCM,SAAU,OAAO,CACrB,GAAG,IAEiD,EAAA;AAIpD,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,IAAI;AAE5B,YAAA,OAAO,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC;QACnC;QAEA,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI;YAEpB,OAAO,CAAC,MAAS,KAAK,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC;QAClD;;AAEJ;AAEA,MAAM,WAAW,GAAG,CAClB,MAAS,EACT,KAAqC,KACW;AAChD,IAAA,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE;AAClB,QAAA,OAAO,IAAI;;AAET,QAAA,MAAM,CAAC,KAAoB;;AAE3B,QAAA,KAAK,CAAC,MAAM,CAAC,OAAwB,CAAC,CACvC;IACH;;AAGA,IAAA,OAAO,MAAsD;AAC/D,CAAC;;;;"}
|
|
@@ -11,7 +11,10 @@ import { type UnwrapOk } from './types.mjs';
|
|
|
11
11
|
*
|
|
12
12
|
* assert.deepStrictEqual(TernaryResult.toOptional(okValue), Optional.some(7));
|
|
13
13
|
*
|
|
14
|
-
* assert.deepStrictEqual(
|
|
14
|
+
* assert.deepStrictEqual(
|
|
15
|
+
* TernaryResult.toOptional(warnValue),
|
|
16
|
+
* Optional.some(7),
|
|
17
|
+
* );
|
|
15
18
|
* ```
|
|
16
19
|
*/
|
|
17
20
|
export declare const toOptional: <R extends UnknownTernaryResult>(result: R) => Optional<UnwrapOk<R>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-to-optional.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-to-optional.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"ternary-result-to-optional.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-to-optional.mts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,oBAAoB,EACvD,QAAQ,CAAC,KACR,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAIJ,CAAC"}
|
|
@@ -15,7 +15,10 @@ import { isWarn } from './ternary-result-is-warn.mjs';
|
|
|
15
15
|
*
|
|
16
16
|
* assert.deepStrictEqual(TernaryResult.toOptional(okValue), Optional.some(7));
|
|
17
17
|
*
|
|
18
|
-
* assert.deepStrictEqual(
|
|
18
|
+
* assert.deepStrictEqual(
|
|
19
|
+
* TernaryResult.toOptional(warnValue),
|
|
20
|
+
* Optional.some(7),
|
|
21
|
+
* );
|
|
19
22
|
* ```
|
|
20
23
|
*/
|
|
21
24
|
const toOptional = (result) => isOk(result) || isWarn(result)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-to-optional.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-to-optional.mts"],"sourcesContent":[null],"names":["Optional.some","Optional.none"],"mappings":";;;;;AAKA
|
|
1
|
+
{"version":3,"file":"ternary-result-to-optional.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-to-optional.mts"],"sourcesContent":[null],"names":["Optional.some","Optional.none"],"mappings":";;;;;AAKA;;;;;;;;;;;;;;;;;AAiBG;AACI,MAAM,UAAU,GAAG,CACxB,MAAS,KAET,IAAI,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM;AAC3B;AACE,QAAAA,IAAa,CAAC,MAAM,CAAC,KAAoB;AAC3C,MAAEC;;;;"}
|
|
@@ -7,7 +7,10 @@ import { type UnwrapErr } from './types.mjs';
|
|
|
7
7
|
* ```ts
|
|
8
8
|
* const okValue = TernaryResult.ok('value');
|
|
9
9
|
*
|
|
10
|
-
* assert.strictEqual(
|
|
10
|
+
* assert.strictEqual(
|
|
11
|
+
* TernaryResult.unwrapErrOr(okValue, 'default'),
|
|
12
|
+
* 'default',
|
|
13
|
+
* );
|
|
11
14
|
*
|
|
12
15
|
* const unwrapErr = TernaryResult.unwrapErrOr('fallback error');
|
|
13
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-unwrap-err-or.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"ternary-result-unwrap-err-or.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,oBAAoB,EAAE,CAAC,EAC3D,MAAM,EAAE,CAAC,EACT,YAAY,EAAE,CAAC,GACd,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAGpB,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAC9B,YAAY,EAAE,CAAC,GACd,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-unwrap-err-or.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts"],"sourcesContent":[null],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ternary-result-unwrap-err-or.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-unwrap-err-or.mts"],"sourcesContent":[null],"names":[],"mappings":";;AAoCM,SAAU,WAAW,CACzB,GAAG,IAAwE,EAAA;AAE3E,IAAA,QAAQ,IAAI,CAAC,MAAM;QACjB,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,IAAI;AAEnC,YAAA,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,YAAY;QAC1C;QAEA,KAAK,CAAC,EAAE;AACN,YAAA,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI;YAE3B,OAAO,CAAC,MAAS,KAAK,SAAS,CAAC,MAAM,CAAC,IAAI,YAAY;QACzD;;AAEJ;;;;"}
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
* @example
|
|
5
5
|
*
|
|
6
6
|
* ```ts
|
|
7
|
-
* const okPair = TernaryResult.zip(
|
|
7
|
+
* const okPair = TernaryResult.zip(
|
|
8
|
+
* TernaryResult.ok('left'),
|
|
9
|
+
* TernaryResult.ok(1),
|
|
10
|
+
* );
|
|
8
11
|
*
|
|
9
12
|
* const warnPair = TernaryResult.zip(
|
|
10
13
|
* TernaryResult.warn('left', 'warn'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-zip.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-zip.mts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"ternary-result-zip.d.mts","sourceRoot":"","sources":["../../../../src/functional/ternary-result/impl/ternary-result-zip.mts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,GAAG,GAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EACxC,SAAS,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAClC,SAAS,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,KACjC,aAAa,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAoBnD,CAAC"}
|
|
@@ -9,7 +9,10 @@ import { warn } from './ternary-result-warn.mjs';
|
|
|
9
9
|
* @example
|
|
10
10
|
*
|
|
11
11
|
* ```ts
|
|
12
|
-
* const okPair = TernaryResult.zip(
|
|
12
|
+
* const okPair = TernaryResult.zip(
|
|
13
|
+
* TernaryResult.ok('left'),
|
|
14
|
+
* TernaryResult.ok(1),
|
|
15
|
+
* );
|
|
13
16
|
*
|
|
14
17
|
* const warnPair = TernaryResult.zip(
|
|
15
18
|
* TernaryResult.warn('left', 'warn'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ternary-result-zip.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-zip.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA
|
|
1
|
+
{"version":3,"file":"ternary-result-zip.mjs","sources":["../../../../src/functional/ternary-result/impl/ternary-result-zip.mts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;MACU,GAAG,GAAG,CACjB,OAAkC,EAClC,OAAkC,KACoB;AACtD,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE;AAClB,QAAA,OAAO,OAAO;IAChB;AAEA,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE;AAClB,QAAA,OAAO,OAAO;IAChB;IAEA,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAU;AAEpD,IAAA,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE;QACnB,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC;IACpC;AAEA,IAAA,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE;QACnB,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC;IACpC;AAEA,IAAA,OAAO,EAAE,CAAC,IAAI,CAAC;AACjB;;;;"}
|
package/dist/guard/is-record.mjs
CHANGED
|
@@ -25,7 +25,7 @@ import { isNonNullObject } from './is-non-null-object.mjs';
|
|
|
25
25
|
* @example
|
|
26
26
|
*
|
|
27
27
|
* ```ts
|
|
28
|
-
* const entries: unknown[] = [{ id: 1 },
|
|
28
|
+
* const entries: unknown[] = [{ id: 1 }, 'str', 0, null];
|
|
29
29
|
*
|
|
30
30
|
* const records = entries.filter(isRecord);
|
|
31
31
|
*
|
package/dist/json/json.d.mts
CHANGED
|
@@ -240,11 +240,13 @@ export declare namespace Json {
|
|
|
240
240
|
* );
|
|
241
241
|
*
|
|
242
242
|
* assert.isTrue(
|
|
243
|
-
* formatted.value.indexOf('"mango"') <
|
|
243
|
+
* formatted.value.indexOf('"mango"') <
|
|
244
|
+
* formatted.value.indexOf('"nested"'),
|
|
244
245
|
* );
|
|
245
246
|
*
|
|
246
247
|
* assert.isTrue(
|
|
247
|
-
* formatted.value.indexOf('"nested"') <
|
|
248
|
+
* formatted.value.indexOf('"nested"') <
|
|
249
|
+
* formatted.value.indexOf('"zebra"'),
|
|
248
250
|
* );
|
|
249
251
|
* }
|
|
250
252
|
* ```
|
package/dist/json/json.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.mts","sourceRoot":"","sources":["../../src/json/json.mts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,yBAAiB,IAAI,CAAC;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoDG;IACI,MAAM,KAAK,GAChB,MAAM,MAAM,EACZ,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,OAAO,KAClE,MAAM,CAAC,SAAS,EAAE,MAAM,CAc1B,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+DG;IACI,MAAM,SAAS,GACpB,OAAO,OAAO,EACd,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO,EAChE,QAAQ,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,KACzC,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,CAQnC,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgEG;IACI,MAAM,iBAAiB,GAC5B,OAAO,OAAO,EACd,yBAAyB,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EACrD,QAAQ,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,KACzC,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,CAUnC,CAAC;IAEF
|
|
1
|
+
{"version":3,"file":"json.d.mts","sourceRoot":"","sources":["../../src/json/json.mts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,yBAAiB,IAAI,CAAC;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoDG;IACI,MAAM,KAAK,GAChB,MAAM,MAAM,EACZ,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,KAAK,OAAO,KAClE,MAAM,CAAC,SAAS,EAAE,MAAM,CAc1B,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+DG;IACI,MAAM,SAAS,GACpB,OAAO,OAAO,EACd,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO,EAChE,QAAQ,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,KACzC,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,CAQnC,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgEG;IACI,MAAM,iBAAiB,GAC5B,OAAO,OAAO,EACd,yBAAyB,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EACrD,QAAQ,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,KACzC,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,CAUnC,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4EG;IACI,MAAM,kBAAkB,GAC7B,OAAO,aAAa,EACpB,QAAQ,kBAAkB,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,KACzC,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,CAMnC,CAAC;CACH"}
|
package/dist/json/json.mjs
CHANGED
|
@@ -310,11 +310,13 @@ var Json;
|
|
|
310
310
|
* );
|
|
311
311
|
*
|
|
312
312
|
* assert.isTrue(
|
|
313
|
-
* formatted.value.indexOf('"mango"') <
|
|
313
|
+
* formatted.value.indexOf('"mango"') <
|
|
314
|
+
* formatted.value.indexOf('"nested"'),
|
|
314
315
|
* );
|
|
315
316
|
*
|
|
316
317
|
* assert.isTrue(
|
|
317
|
-
* formatted.value.indexOf('"nested"') <
|
|
318
|
+
* formatted.value.indexOf('"nested"') <
|
|
319
|
+
* formatted.value.indexOf('"zebra"'),
|
|
318
320
|
* );
|
|
319
321
|
* }
|
|
320
322
|
* ```
|
package/dist/json/json.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.mjs","sources":["../../src/json/json.mts"],"sourcesContent":[null],"names":["Result.ok","Result.err","Arr.uniq"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;AAIG;AACG,IAAW;AAAjB,CAAA,UAAiB,IAAI,EAAA;AACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDG;AACU,IAAA,IAAA,CAAA,KAAK,GAAG,CACnB,IAAY,EACZ,OAAmE,KACtC;AAC7B,QAAA,IAAI;YACF,OAAOA,EAAS,CACd,IAAI,CAAC,KAAK,CACR,IAAI;;YAEJ,OAAkE,CACnE,CACF;QACH;QAAE,OAAO,KAAc,EAAE;AACvB,YAAA,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC;AAErC,YAAA,OAAOC,GAAU,CAAC,MAAM,CAAC;QAC3B;AACF,IAAA,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DG;IACU,IAAA,CAAA,SAAS,GAAG,CACvB,KAAc,EACd,QAAgE,EAChE,KAA0C,KACJ;AACtC,QAAA,IAAI;AACF,YAAA,OAAOD,EAAS,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC1D;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC;AAErC,YAAA,OAAOC,GAAU,CAAC,MAAM,CAAC;QAC3B;AACF,IAAA,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEG;IACU,IAAA,CAAA,iBAAiB,GAAG,CAC/B,KAAc,EACd,sBAAqD,EACrD,KAA0C,KACJ;AACtC,QAAA,IAAI;AACF,YAAA,OAAOD,EAAS,CACd,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC,sBAAsB,CAAC,EAAE,KAAK,CAAC,CAClE;QACH;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC;AAErC,YAAA,OAAOC,GAAU,CAAC,MAAM,CAAC;QAC3B;AACF,IAAA,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"json.mjs","sources":["../../src/json/json.mts"],"sourcesContent":[null],"names":["Result.ok","Result.err","Arr.uniq"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-data-forge",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"clean:logs": "npx rimraf ./*.log",
|
|
44
44
|
"cspell": "cspell \"**\" --gitignore --gitignore-root ./ --no-progress",
|
|
45
45
|
"doc": "tsx ./scripts/cmd/gen-docs.mts",
|
|
46
|
-
"doc:embed
|
|
47
|
-
"doc:embed
|
|
46
|
+
"doc:embed": "tsx ./scripts/cmd/embed-examples.mts",
|
|
47
|
+
"doc:embed:jsdoc": "tsx ./scripts/cmd/embed-examples-in-jsdoc.mts",
|
|
48
48
|
"doc:preview": "vite preview --config ./configs/vite.doc.config.mts",
|
|
49
49
|
"doc:watch": "typedoc --options ./configs/typedoc.config.mjs --watch",
|
|
50
50
|
"fmt": "format-uncommitted",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"type-check": "tsc --noEmit",
|
|
74
74
|
"update-packages": "pnpm update --latest",
|
|
75
75
|
"z:vitest": "vitest --config ./configs/vitest.config.mts",
|
|
76
|
-
"z:vitest:node": "
|
|
76
|
+
"z:vitest:node": "pnpm run z:vitest --project='Node.js'"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@sindresorhus/is": "^7.2.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@emotion/react": "11.14.0",
|
|
84
84
|
"@emotion/styled": "11.14.1",
|
|
85
|
-
"@mui/material": "7.3.
|
|
85
|
+
"@mui/material": "7.3.7",
|
|
86
86
|
"@rollup/plugin-replace": "6.0.3",
|
|
87
87
|
"@rollup/plugin-strip": "3.0.4",
|
|
88
88
|
"@rollup/plugin-typescript": "12.3.0",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"@semantic-release/github": "12.0.2",
|
|
94
94
|
"@semantic-release/npm": "13.1.3",
|
|
95
95
|
"@semantic-release/release-notes-generator": "14.1.0",
|
|
96
|
-
"@types/node": "25.0.
|
|
97
|
-
"@types/react": "19.2.
|
|
96
|
+
"@types/node": "25.0.7",
|
|
97
|
+
"@types/react": "19.2.8",
|
|
98
98
|
"@vitest/browser-playwright": "4.0.16",
|
|
99
99
|
"@vitest/coverage-v8": "4.0.16",
|
|
100
100
|
"@vitest/ui": "4.0.16",
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"cspell": "9.4.0",
|
|
103
103
|
"dedent": "^1.7.1",
|
|
104
104
|
"eslint": "9.39.2",
|
|
105
|
-
"eslint-config-typed": "4.
|
|
106
|
-
"github-settings-as-code": "1.0.
|
|
105
|
+
"eslint-config-typed": "4.4.1",
|
|
106
|
+
"github-settings-as-code": "1.0.7",
|
|
107
107
|
"immer": "11.1.3",
|
|
108
108
|
"jiti": "2.6.1",
|
|
109
109
|
"markdownlint": "0.40.0",
|
|
@@ -113,9 +113,9 @@
|
|
|
113
113
|
"prettier": "3.7.4",
|
|
114
114
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
115
115
|
"prettier-plugin-packagejson": "2.5.20",
|
|
116
|
-
"rollup": "4.
|
|
116
|
+
"rollup": "4.55.1",
|
|
117
117
|
"semantic-release": "25.0.2",
|
|
118
|
-
"ts-repo-utils": "8.0.
|
|
118
|
+
"ts-repo-utils": "8.0.2",
|
|
119
119
|
"tslib": "2.8.1",
|
|
120
120
|
"tsx": "4.21.0",
|
|
121
121
|
"typedoc": "0.28.15",
|
|
@@ -128,6 +128,10 @@
|
|
|
128
128
|
"typescript": ">=4.8"
|
|
129
129
|
},
|
|
130
130
|
"packageManager": "pnpm@10.24.0",
|
|
131
|
+
"engines": {
|
|
132
|
+
"node": ">=20.11.0",
|
|
133
|
+
"pnpm": ">=8.0.0"
|
|
134
|
+
},
|
|
131
135
|
"volta": {
|
|
132
136
|
"node": "25.2.1"
|
|
133
137
|
}
|
|
@@ -167,7 +167,10 @@ export function minBy<E, V>(
|
|
|
167
167
|
*
|
|
168
168
|
* assert.deepStrictEqual(mostStars, Optional.some({ id: 'b', stars: 30 }));
|
|
169
169
|
*
|
|
170
|
-
* assert.deepStrictEqual(
|
|
170
|
+
* assert.deepStrictEqual(
|
|
171
|
+
* smallestStars,
|
|
172
|
+
* Optional.some({ id: 'a', stars: 10 }),
|
|
173
|
+
* );
|
|
171
174
|
* ```
|
|
172
175
|
*/
|
|
173
176
|
export function maxBy<const Ar extends readonly unknown[]>(
|
|
@@ -257,7 +257,9 @@ export function findIndex<E>(
|
|
|
257
257
|
* const lastIndexOfB = Arr.findLastIndex(letters, (letter) => letter === 'b');
|
|
258
258
|
*
|
|
259
259
|
* // eslint-disable-next-line unicorn/prefer-array-index-of
|
|
260
|
-
* const notFound = Arr.findLastIndex<string>((letter) => letter === 'z')(
|
|
260
|
+
* const notFound = Arr.findLastIndex<string>((letter) => letter === 'z')(
|
|
261
|
+
* letters,
|
|
262
|
+
* );
|
|
261
263
|
*
|
|
262
264
|
* assert.isTrue(lastIndexOfB === 3);
|
|
263
265
|
*
|
|
@@ -15,9 +15,9 @@ import { size } from './array-utils-size.mjs';
|
|
|
15
15
|
*
|
|
16
16
|
* const doubled = Arr.map(numbers, (value) => value * 2);
|
|
17
17
|
*
|
|
18
|
-
* const indexed = Arr.map<number, string>(
|
|
19
|
-
*
|
|
20
|
-
* );
|
|
18
|
+
* const indexed = Arr.map<number, string>(
|
|
19
|
+
* (value, index) => `${index}:${value}`,
|
|
20
|
+
* )(numbers);
|
|
21
21
|
*
|
|
22
22
|
* assert.deepStrictEqual(doubled, [2, 4, 6]);
|
|
23
23
|
*
|
|
@@ -65,7 +65,11 @@ export function map<A, B>(
|
|
|
65
65
|
* ```ts
|
|
66
66
|
* const changes = [5, -2, 3] as const;
|
|
67
67
|
*
|
|
68
|
-
* const runningTotals = Arr.scan(
|
|
68
|
+
* const runningTotals = Arr.scan(
|
|
69
|
+
* changes,
|
|
70
|
+
* (total, change) => total + change,
|
|
71
|
+
* 0,
|
|
72
|
+
* );
|
|
69
73
|
*
|
|
70
74
|
* const runningTotalsFromCurried = Arr.scan(
|
|
71
75
|
* (total: number, change: number) => total + change,
|
|
@@ -244,7 +248,10 @@ export const toSorted = <const Ar extends readonly unknown[]>(
|
|
|
244
248
|
*
|
|
245
249
|
* assert.deepStrictEqual(byIssueCount, expectedByIssues);
|
|
246
250
|
*
|
|
247
|
-
* assert.deepStrictEqual(
|
|
251
|
+
* assert.deepStrictEqual(
|
|
252
|
+
* byIssueCountDescending,
|
|
253
|
+
* expectedByIssueCountDescending,
|
|
254
|
+
* );
|
|
248
255
|
* ```
|
|
249
256
|
*/
|
|
250
257
|
export function toSortedBy<const Ar extends readonly unknown[]>(
|
package/src/collections/imap.mts
CHANGED
|
@@ -569,7 +569,10 @@ type IMapInterface<K extends MapSetKeyType, V> = Readonly<{
|
|
|
569
569
|
* @example
|
|
570
570
|
*
|
|
571
571
|
* ```ts
|
|
572
|
-
* const entries = [['key', 1]] satisfies readonly (readonly [
|
|
572
|
+
* const entries = [['key', 1]] satisfies readonly (readonly [
|
|
573
|
+
* string,
|
|
574
|
+
* number,
|
|
575
|
+
* ])[];
|
|
573
576
|
*
|
|
574
577
|
* const map = IMap.create(entries);
|
|
575
578
|
*
|
|
@@ -153,7 +153,8 @@ type ISetMappedInterface<K, KM extends MapSetKeyType> = Readonly<{
|
|
|
153
153
|
* const allEven = set.every((point) => point.x % 2 === 0);
|
|
154
154
|
*
|
|
155
155
|
* const narrowed = set.every(
|
|
156
|
-
* (point): point is Readonly<{ x: 2 | 4; tag: 'even' }> =>
|
|
156
|
+
* (point): point is Readonly<{ x: 2 | 4; tag: 'even' }> =>
|
|
157
|
+
* point.x % 2 === 0,
|
|
157
158
|
* );
|
|
158
159
|
*
|
|
159
160
|
* assert.isTrue(allEven);
|
package/src/collections/iset.mts
CHANGED
|
@@ -92,7 +92,9 @@ type ISetInterface<K extends MapSetKeyType> = Readonly<{
|
|
|
92
92
|
*
|
|
93
93
|
* const allEven = numbers.every((value) => value % 2 === 0);
|
|
94
94
|
*
|
|
95
|
-
* const narrowed = numbers.every(
|
|
95
|
+
* const narrowed = numbers.every(
|
|
96
|
+
* (value): value is 2 | 4 | 6 => value % 2 === 0,
|
|
97
|
+
* );
|
|
96
98
|
*
|
|
97
99
|
* assert.isTrue(allEven);
|
|
98
100
|
*
|