@fgv/ts-utils 4.2.2 → 4.4.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/CHANGELOG.json +18 -0
- package/CHANGELOG.md +13 -1
- package/dist/ts-utils.d.ts +3177 -2645
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -1
- package/lib/packlets/base/result.d.ts +33 -0
- package/lib/packlets/base/result.d.ts.map +1 -1
- package/lib/packlets/base/result.js +24 -0
- package/lib/packlets/base/result.js.map +1 -1
- package/lib/packlets/collections/collectible.d.ts +80 -0
- package/lib/packlets/collections/collectible.d.ts.map +1 -0
- package/lib/packlets/collections/collectible.js +93 -0
- package/lib/packlets/collections/collectible.js.map +1 -0
- package/lib/packlets/collections/collector.d.ts +194 -0
- package/lib/packlets/collections/collector.d.ts.map +1 -0
- package/lib/packlets/collections/collector.js +189 -0
- package/lib/packlets/collections/collector.js.map +1 -0
- package/lib/packlets/collections/collectorConverter.d.ts +86 -0
- package/lib/packlets/collections/collectorConverter.d.ts.map +1 -0
- package/lib/packlets/collections/collectorConverter.js +98 -0
- package/lib/packlets/collections/collectorConverter.js.map +1 -0
- package/lib/packlets/collections/collectors.d.ts +31 -0
- package/lib/packlets/collections/collectors.d.ts.map +1 -0
- package/lib/packlets/collections/collectors.js +54 -0
- package/lib/packlets/collections/collectors.js.map +1 -0
- package/lib/packlets/collections/convertingCollector.d.ts +73 -0
- package/lib/packlets/collections/convertingCollector.d.ts.map +1 -0
- package/lib/packlets/collections/convertingCollector.js +67 -0
- package/lib/packlets/collections/convertingCollector.js.map +1 -0
- package/lib/packlets/collections/convertingResultMap.d.ts +53 -0
- package/lib/packlets/collections/convertingResultMap.d.ts.map +1 -0
- package/lib/packlets/collections/convertingResultMap.js +61 -0
- package/lib/packlets/collections/convertingResultMap.js.map +1 -0
- package/lib/packlets/collections/index.d.ts +8 -2
- package/lib/packlets/collections/index.d.ts.map +1 -1
- package/lib/packlets/collections/index.js +8 -2
- package/lib/packlets/collections/index.js.map +1 -1
- package/lib/packlets/collections/keyValueConverters.d.ts +74 -0
- package/lib/packlets/collections/keyValueConverters.d.ts.map +1 -0
- package/lib/packlets/collections/keyValueConverters.js +104 -0
- package/lib/packlets/collections/keyValueConverters.js.map +1 -0
- package/lib/packlets/collections/readonlyResultMap.d.ts +1 -1
- package/lib/packlets/collections/readonlyResultMap.d.ts.map +1 -1
- package/lib/packlets/collections/readonlyResultMap.js.map +1 -1
- package/lib/packlets/collections/{resultMapValidator.d.ts → resultMapConverter.d.ts} +14 -18
- package/lib/packlets/collections/resultMapConverter.d.ts.map +1 -0
- package/lib/packlets/collections/{resultMapValidator.js → resultMapConverter.js} +15 -15
- package/lib/packlets/collections/resultMapConverter.js.map +1 -0
- package/lib/packlets/collections/utils.d.ts +0 -61
- package/lib/packlets/collections/utils.d.ts.map +1 -1
- package/lib/packlets/collections/utils.js +0 -82
- package/lib/packlets/collections/utils.js.map +1 -1
- package/lib/packlets/conversion/baseConverter.d.ts +12 -7
- package/lib/packlets/conversion/baseConverter.d.ts.map +1 -1
- package/lib/packlets/conversion/baseConverter.js +12 -8
- package/lib/packlets/conversion/baseConverter.js.map +1 -1
- package/lib/packlets/conversion/converter.d.ts +6 -6
- package/lib/packlets/conversion/converter.d.ts.map +1 -1
- package/lib/packlets/conversion/converter.js.map +1 -1
- package/lib/packlets/conversion/converters.d.ts +8 -0
- package/lib/packlets/conversion/converters.d.ts.map +1 -1
- package/lib/packlets/conversion/converters.js +11 -0
- package/lib/packlets/conversion/converters.js.map +1 -1
- package/lib/packlets/conversion/objectConverter.d.ts +1 -1
- package/lib/packlets/conversion/objectConverter.d.ts.map +1 -1
- package/lib/packlets/conversion/objectConverter.js.map +1 -1
- package/lib/packlets/validation/common.d.ts +8 -0
- package/lib/packlets/validation/common.d.ts.map +1 -1
- package/lib/packlets/validation/common.js.map +1 -1
- package/lib/packlets/validation/genericValidator.d.ts +4 -6
- package/lib/packlets/validation/genericValidator.d.ts.map +1 -1
- package/lib/packlets/validation/genericValidator.js.map +1 -1
- package/lib/packlets/validation/number.d.ts.map +1 -1
- package/lib/packlets/validation/number.js +3 -1
- package/lib/packlets/validation/number.js.map +1 -1
- package/lib/packlets/validation/string.d.ts.map +1 -1
- package/lib/packlets/validation/string.js +3 -1
- package/lib/packlets/validation/string.js.map +1 -1
- package/lib/packlets/validation/validators.d.ts +12 -2
- package/lib/packlets/validation/validators.d.ts.map +1 -1
- package/lib/packlets/validation/validators.js +13 -0
- package/lib/packlets/validation/validators.js.map +1 -1
- package/package.json +1 -1
- package/lib/packlets/collections/resultMapValidator.d.ts.map +0 -1
- package/lib/packlets/collections/resultMapValidator.js.map +0 -1
- package/lib/packlets/collections/validatingResultMap.d.ts +0 -73
- package/lib/packlets/collections/validatingResultMap.d.ts.map +0 -1
- package/lib/packlets/collections/validatingResultMap.js +0 -102
- package/lib/packlets/collections/validatingResultMap.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Result } from '../base';
|
|
2
|
+
import { ICollectible } from './collectible';
|
|
3
|
+
import { Collector } from './collector';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for creating a {@link SimpleCollector | simple collector}.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface ISimpleCollectorCreateParams<TITEM extends ICollectible<string, number>> {
|
|
9
|
+
items?: TITEM[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A simple {@link Collector | collector} that collects {@link Collections.ICollectible | ICollectible items}
|
|
13
|
+
* with non-branded `string` key and `number` index, and with no transformation other than index assignment
|
|
14
|
+
* on addition.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export declare class SimpleCollector<TITEM extends ICollectible<string, number>> extends Collector<string, number, TITEM, TITEM> {
|
|
18
|
+
/**
|
|
19
|
+
* Constructs a new {@link SimpleCollector | simple collector}.
|
|
20
|
+
* @param params - {@link Collections.ISimpleCollectorCreateParams | Creation parameters} for the collector.
|
|
21
|
+
*/
|
|
22
|
+
constructor(params?: ISimpleCollectorCreateParams<TITEM>);
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new {@link SimpleCollector | simple collector}.
|
|
25
|
+
* @param params - {@link Collections.ISimpleCollectorCreateParams | Creation parameters} for the collector.
|
|
26
|
+
* @returns {@link Success | Success} if the collector is created successfully, or {@link Failure | Failure} if not.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
static createSimpleCollector<TITEM extends ICollectible<string, number>>(params?: ISimpleCollectorCreateParams<TITEM>): Result<SimpleCollector<TITEM>>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=collectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectors.d.ts","sourceRoot":"","sources":["../../../src/packlets/collections/collectors.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAiB,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,4BAA4B,CAAC,KAAK,SAAS,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;IACtF,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;CACjB;AAED;;;;;GAKG;AACH,qBAAa,eAAe,CAAC,KAAK,SAAS,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAE,SAAQ,SAAS,CACxF,MAAM,EACN,MAAM,EACN,KAAK,EACL,KAAK,CACN;IACC;;;OAGG;gBACgB,MAAM,CAAC,EAAE,4BAA4B,CAAC,KAAK,CAAC;IAK/D;;;;;OAKG;WACW,qBAAqB,CAAC,KAAK,SAAS,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5E,MAAM,CAAC,EAAE,4BAA4B,CAAC,KAAK,CAAC,GAC3C,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;CAGlC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.SimpleCollector = void 0;
|
|
25
|
+
const base_1 = require("../base");
|
|
26
|
+
const collector_1 = require("./collector");
|
|
27
|
+
/**
|
|
28
|
+
* A simple {@link Collector | collector} that collects {@link Collections.ICollectible | ICollectible items}
|
|
29
|
+
* with non-branded `string` key and `number` index, and with no transformation other than index assignment
|
|
30
|
+
* on addition.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
class SimpleCollector extends collector_1.Collector {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new {@link SimpleCollector | simple collector}.
|
|
36
|
+
* @param params - {@link Collections.ISimpleCollectorCreateParams | Creation parameters} for the collector.
|
|
37
|
+
*/
|
|
38
|
+
constructor(params) {
|
|
39
|
+
var _a;
|
|
40
|
+
const entries = (_a = params === null || params === void 0 ? void 0 : params.items) === null || _a === void 0 ? void 0 : _a.map((item) => [item.key, item]);
|
|
41
|
+
super({ factory: collector_1.Collector._simpleFactory, entries });
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new {@link SimpleCollector | simple collector}.
|
|
45
|
+
* @param params - {@link Collections.ISimpleCollectorCreateParams | Creation parameters} for the collector.
|
|
46
|
+
* @returns {@link Success | Success} if the collector is created successfully, or {@link Failure | Failure} if not.
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
static createSimpleCollector(params) {
|
|
50
|
+
return (0, base_1.captureResult)(() => new SimpleCollector(params));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.SimpleCollector = SimpleCollector;
|
|
54
|
+
//# sourceMappingURL=collectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectors.js","sourceRoot":"","sources":["../../../src/packlets/collections/collectors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,kCAAgD;AAEhD,2CAAwC;AAUxC;;;;;GAKG;AACH,MAAa,eAA4D,SAAQ,qBAKhF;IACC;;;OAGG;IACH,YAAmB,MAA4C;;QAC7D,MAAM,OAAO,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,0CAAE,GAAG,CAAC,CAAC,IAAI,EAAmB,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QAChF,KAAK,CAAC,EAAE,OAAO,EAAE,qBAAS,CAAC,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;IACxD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,qBAAqB,CACjC,MAA4C;QAE5C,OAAO,IAAA,oBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1D,CAAC;CACF;AA1BD,0CA0BC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, captureResult } from '../base';\nimport { ICollectible } from './collectible';\nimport { Collector } from './collector';\n\n/**\n * Parameters for creating a {@link SimpleCollector | simple collector}.\n * @public\n */\nexport interface ISimpleCollectorCreateParams<TITEM extends ICollectible<string, number>> {\n items?: TITEM[];\n}\n\n/**\n * A simple {@link Collector | collector} that collects {@link Collections.ICollectible | ICollectible items}\n * with non-branded `string` key and `number` index, and with no transformation other than index assignment\n * on addition.\n * @public\n */\nexport class SimpleCollector<TITEM extends ICollectible<string, number>> extends Collector<\n string,\n number,\n TITEM,\n TITEM\n> {\n /**\n * Constructs a new {@link SimpleCollector | simple collector}.\n * @param params - {@link Collections.ISimpleCollectorCreateParams | Creation parameters} for the collector.\n */\n public constructor(params?: ISimpleCollectorCreateParams<TITEM>) {\n const entries = params?.items?.map((item): [string, TITEM] => [item.key, item]);\n super({ factory: Collector._simpleFactory, entries });\n }\n\n /**\n * Creates a new {@link SimpleCollector | simple collector}.\n * @param params - {@link Collections.ISimpleCollectorCreateParams | Creation parameters} for the collector.\n * @returns {@link Success | Success} if the collector is created successfully, or {@link Failure | Failure} if not.\n * @public\n */\n public static createSimpleCollector<TITEM extends ICollectible<string, number>>(\n params?: ISimpleCollectorCreateParams<TITEM>\n ): Result<SimpleCollector<TITEM>> {\n return captureResult(() => new SimpleCollector(params));\n }\n}\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Result } from '../base';
|
|
2
|
+
import { CollectibleFactory, ICollectible } from './collectible';
|
|
3
|
+
import { Collector } from './collector';
|
|
4
|
+
import { CollectorConverter, IReadOnlyCollectorConverter } from './collectorConverter';
|
|
5
|
+
import { KeyValueEntry } from './common';
|
|
6
|
+
import { IReadOnlyConvertingResultMap } from './convertingResultMap';
|
|
7
|
+
import { KeyValueConverters } from './keyValueConverters';
|
|
8
|
+
/**
|
|
9
|
+
* A read-only interface exposing non-mutating methods of a
|
|
10
|
+
* {@link Collections.ConvertingCollector | ConvertingCollector}.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface IReadOnlyConvertingCollector<TKEY extends string = string, TINDEX extends number = number, TITEM extends ICollectible<TKEY, TINDEX> = ICollectible<TKEY, TINDEX>> extends IReadOnlyConvertingResultMap<TKEY, TITEM> {
|
|
14
|
+
/**
|
|
15
|
+
* {@inheritdoc Collections.ConvertingCollector.converting}
|
|
16
|
+
*/
|
|
17
|
+
readonly converting: IReadOnlyCollectorConverter<TKEY, TINDEX, TITEM>;
|
|
18
|
+
/**
|
|
19
|
+
* {@inheritdoc Collections.Collector.getAt}
|
|
20
|
+
*/
|
|
21
|
+
readonly getAt: (index: number) => Result<TITEM>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parameters for constructing a {@link Collections.ConvertingCollector | ConvertingCollector}.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export interface IConvertingCollectorConstructorParams<TKEY extends string = string, TINDEX extends number = number, TITEM extends ICollectible<TKEY, TINDEX> = ICollectible<TKEY, TINDEX>, TSRC = TITEM> {
|
|
28
|
+
/**
|
|
29
|
+
* {@inheritdoc Collections.ICollectorConstructorParams.factory}
|
|
30
|
+
*/
|
|
31
|
+
factory: CollectibleFactory<TKEY, TINDEX, TITEM, TSRC>;
|
|
32
|
+
/**
|
|
33
|
+
* {@inheritdoc Collections.ICollectorConverterCreateParams.converters}
|
|
34
|
+
*/
|
|
35
|
+
converters: KeyValueConverters<TKEY, TSRC>;
|
|
36
|
+
/**
|
|
37
|
+
* {@inheritdoc Collections.ICollectorConstructorParams.entries}
|
|
38
|
+
*/
|
|
39
|
+
entries?: KeyValueEntry<TKEY, TSRC>[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A {@link Collections.Collector | Collector} with a {@link Collections.CollectorConverter | CollectorConverter}
|
|
43
|
+
* property that enables validated use of the underlying map with weakly-typed keys and values.
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export declare class ConvertingCollector<TKEY extends string = string, TINDEX extends number = number, TITEM extends ICollectible<TKEY, TINDEX> = ICollectible<TKEY, TINDEX>, TSRC = TITEM> extends Collector<TKEY, TINDEX, TITEM, TSRC> {
|
|
47
|
+
/**
|
|
48
|
+
* A {@link Collections.CollectorConverter | CollectorConverter} which validates keys and values
|
|
49
|
+
* before inserting them into this collector.
|
|
50
|
+
*/
|
|
51
|
+
readonly converting: CollectorConverter<TKEY, TINDEX, TITEM, TSRC>;
|
|
52
|
+
protected readonly _converters: KeyValueConverters<TKEY, TSRC>;
|
|
53
|
+
/**
|
|
54
|
+
* Constructs a new {@link Collections.ConvertingCollector | ConvertingCollector}
|
|
55
|
+
* from the supplied {@link Collections.IConvertingCollectorConstructorParams | parameters}.
|
|
56
|
+
* @param params - Required parameters for constructing the collector.
|
|
57
|
+
*/
|
|
58
|
+
constructor(params: IConvertingCollectorConstructorParams<TKEY, TINDEX, TITEM, TSRC>);
|
|
59
|
+
/**
|
|
60
|
+
* Creates a new {@link Collections.ConvertingCollector | ConvertingCollector} instance from
|
|
61
|
+
* the supplied {@link Collections.IConvertingCollectorConstructorParams | parameters}.
|
|
62
|
+
* @param params - Required parameters for constructing the collector.
|
|
63
|
+
* @returns {@link Success} with the new collector if successful, {@link Failure} otherwise.
|
|
64
|
+
*/
|
|
65
|
+
static createConvertingCollector<TKEY extends string = string, TINDEX extends number = number, TITEM extends ICollectible<TKEY, TINDEX> = ICollectible<TKEY, TINDEX>, TSRC = TITEM>(params: IConvertingCollectorConstructorParams<TKEY, TINDEX, TITEM, TSRC>): Result<ConvertingCollector<TKEY, TINDEX, TITEM, TSRC>>;
|
|
66
|
+
/**
|
|
67
|
+
* Gets a read-only version of this collector as a
|
|
68
|
+
* {@link Collections.IReadOnlyConvertingResultMap | read-only map}.
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
toReadOnly(): IReadOnlyConvertingCollector<TKEY, TINDEX, TITEM>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=convertingCollector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertingCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/collections/convertingCollector.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,MAAM,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,SAAS,EA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y
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.ConvertingCollector = void 0;
|
|
25
|
+
const base_1 = require("../base");
|
|
26
|
+
const collector_1 = require("./collector");
|
|
27
|
+
const collectorConverter_1 = require("./collectorConverter");
|
|
28
|
+
/**
|
|
29
|
+
* A {@link Collections.Collector | Collector} with a {@link Collections.CollectorConverter | CollectorConverter}
|
|
30
|
+
* property that enables validated use of the underlying map with weakly-typed keys and values.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
class ConvertingCollector extends collector_1.Collector {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new {@link Collections.ConvertingCollector | ConvertingCollector}
|
|
36
|
+
* from the supplied {@link Collections.IConvertingCollectorConstructorParams | parameters}.
|
|
37
|
+
* @param params - Required parameters for constructing the collector.
|
|
38
|
+
*/
|
|
39
|
+
constructor(params) {
|
|
40
|
+
var _a;
|
|
41
|
+
super({ factory: params.factory });
|
|
42
|
+
this._converters = params.converters;
|
|
43
|
+
this.converting = new collectorConverter_1.CollectorConverter({ collector: this, converters: params.converters });
|
|
44
|
+
for (const entry of (_a = params.entries) !== null && _a !== void 0 ? _a : []) {
|
|
45
|
+
this.getOrAdd(entry[0], entry[1]).orThrow();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Creates a new {@link Collections.ConvertingCollector | ConvertingCollector} instance from
|
|
50
|
+
* the supplied {@link Collections.IConvertingCollectorConstructorParams | parameters}.
|
|
51
|
+
* @param params - Required parameters for constructing the collector.
|
|
52
|
+
* @returns {@link Success} with the new collector if successful, {@link Failure} otherwise.
|
|
53
|
+
*/
|
|
54
|
+
static createConvertingCollector(params) {
|
|
55
|
+
return (0, base_1.captureResult)(() => new ConvertingCollector(params));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Gets a read-only version of this collector as a
|
|
59
|
+
* {@link Collections.IReadOnlyConvertingResultMap | read-only map}.
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
toReadOnly() {
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.ConvertingCollector = ConvertingCollector;
|
|
67
|
+
//# sourceMappingURL=convertingCollector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertingCollector.js","sourceRoot":"","sources":["../../../src/packlets/collections/convertingCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,kCAAgD;AAEhD,2CAAwC;AACxC,6DAAuF;AAqDvF;;;;GAIG;AACH,MAAa,mBAKX,SAAQ,qBAAoC;IAS5C;;;;OAIG;IACH,YAAmB,MAAwE;;QACzF,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,IAAI,uCAAkB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAC7F,KAAK,MAAM,KAAK,IAAI,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE,EAAE,CAAC;YACzC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAC9C,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,yBAAyB,CAMrC,MAAwE;QAExE,OAAO,IAAA,oBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACI,UAAU;QACf,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArDD,kDAqDC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Result } from '../base';\nimport { CollectibleFactory, ICollectible } from './collectible';\nimport { Collector } from './collector';\nimport { CollectorConverter, IReadOnlyCollectorConverter } from './collectorConverter';\nimport { KeyValueEntry } from './common';\nimport { IReadOnlyConvertingResultMap } from './convertingResultMap';\nimport { KeyValueConverters } from './keyValueConverters';\n\n/**\n * A read-only interface exposing non-mutating methods of a\n * {@link Collections.ConvertingCollector | ConvertingCollector}.\n * @public\n */\n\nexport interface IReadOnlyConvertingCollector<\n TKEY extends string = string,\n TINDEX extends number = number,\n TITEM extends ICollectible<TKEY, TINDEX> = ICollectible<TKEY, TINDEX>\n> extends IReadOnlyConvertingResultMap<TKEY, TITEM> {\n /**\n * {@inheritdoc Collections.ConvertingCollector.converting}\n */\n readonly converting: IReadOnlyCollectorConverter<TKEY, TINDEX, TITEM>;\n\n /**\n * {@inheritdoc Collections.Collector.getAt}\n */\n readonly getAt: (index: number) => Result<TITEM>;\n}\n\n/**\n * Parameters for constructing a {@link Collections.ConvertingCollector | ConvertingCollector}.\n * @public\n */\nexport interface IConvertingCollectorConstructorParams<\n TKEY extends string = string,\n TINDEX extends number = number,\n TITEM extends ICollectible<TKEY, TINDEX> = ICollectible<TKEY, TINDEX>,\n TSRC = TITEM\n> {\n /**\n * {@inheritdoc Collections.ICollectorConstructorParams.factory}\n */\n factory: CollectibleFactory<TKEY, TINDEX, TITEM, TSRC>;\n\n /**\n * {@inheritdoc Collections.ICollectorConverterCreateParams.converters}\n */\n converters: KeyValueConverters<TKEY, TSRC>;\n\n /**\n * {@inheritdoc Collections.ICollectorConstructorParams.entries}\n */\n entries?: KeyValueEntry<TKEY, TSRC>[];\n}\n\n/**\n * A {@link Collections.Collector | Collector} with a {@link Collections.CollectorConverter | CollectorConverter}\n * property that enables validated use of the underlying map with weakly-typed keys and values.\n * @public\n */\nexport class ConvertingCollector<\n TKEY extends string = string,\n TINDEX extends number = number,\n TITEM extends ICollectible<TKEY, TINDEX> = ICollectible<TKEY, TINDEX>,\n TSRC = TITEM\n> extends Collector<TKEY, TINDEX, TITEM, TSRC> {\n /**\n * A {@link Collections.CollectorConverter | CollectorConverter} which validates keys and values\n * before inserting them into this collector.\n */\n public readonly converting: CollectorConverter<TKEY, TINDEX, TITEM, TSRC>;\n\n protected readonly _converters: KeyValueConverters<TKEY, TSRC>;\n\n /**\n * Constructs a new {@link Collections.ConvertingCollector | ConvertingCollector}\n * from the supplied {@link Collections.IConvertingCollectorConstructorParams | parameters}.\n * @param params - Required parameters for constructing the collector.\n */\n public constructor(params: IConvertingCollectorConstructorParams<TKEY, TINDEX, TITEM, TSRC>) {\n super({ factory: params.factory });\n this._converters = params.converters;\n this.converting = new CollectorConverter({ collector: this, converters: params.converters });\n for (const entry of params.entries ?? []) {\n this.getOrAdd(entry[0], entry[1]).orThrow();\n }\n }\n\n /**\n * Creates a new {@link Collections.ConvertingCollector | ConvertingCollector} instance from\n * the supplied {@link Collections.IConvertingCollectorConstructorParams | parameters}.\n * @param params - Required parameters for constructing the collector.\n * @returns {@link Success} with the new collector if successful, {@link Failure} otherwise.\n */\n public static createConvertingCollector<\n TKEY extends string = string,\n TINDEX extends number = number,\n TITEM extends ICollectible<TKEY, TINDEX> = ICollectible<TKEY, TINDEX>,\n TSRC = TITEM\n >(\n params: IConvertingCollectorConstructorParams<TKEY, TINDEX, TITEM, TSRC>\n ): Result<ConvertingCollector<TKEY, TINDEX, TITEM, TSRC>> {\n return captureResult(() => new ConvertingCollector(params));\n }\n\n /**\n * Gets a read-only version of this collector as a\n * {@link Collections.IReadOnlyConvertingResultMap | read-only map}.\n * @returns\n */\n public toReadOnly(): IReadOnlyConvertingCollector<TKEY, TINDEX, TITEM> {\n return this;\n }\n}\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Result } from '../base';
|
|
2
|
+
import { KeyValueEntry } from './common';
|
|
3
|
+
import { KeyValueConverters } from './keyValueConverters';
|
|
4
|
+
import { IReadOnlyResultMap } from './readonlyResultMap';
|
|
5
|
+
import { ResultMap } from './resultMap';
|
|
6
|
+
import { IReadOnlyResultMapConverter, ResultMapConverter } from './resultMapConverter';
|
|
7
|
+
/**
|
|
8
|
+
* A read-only interface exposing non-mutating methods of a {@link Collections.ConvertingResultMap | ConvertingResultMap}.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface IReadOnlyConvertingResultMap<TK extends string = string, TV = unknown> extends IReadOnlyResultMap<TK, TV> {
|
|
12
|
+
/**
|
|
13
|
+
* {@inheritdoc Collections.ConvertingResultMap.converting}
|
|
14
|
+
*/
|
|
15
|
+
readonly converting: IReadOnlyResultMapConverter<TK, TV>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parameters for constructing a {@link Collections.ResultMap | ResultMap}.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export interface IConvertingResultMapConstructorParams<TK extends string = string, TV = unknown> {
|
|
22
|
+
entries?: Iterable<KeyValueEntry<string, unknown>>;
|
|
23
|
+
converters: KeyValueConverters<TK, TV>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A {@link Collections.ResultMap | ResultMap} with a {@link Collections.ResultMapConverter | validator}
|
|
27
|
+
* property that enables validated use of the underlying map with weakly-typed keys and values.
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export declare class ConvertingResultMap<TK extends string = string, TV = unknown> extends ResultMap<TK, TV> implements IReadOnlyConvertingResultMap<TK, TV> {
|
|
31
|
+
/**
|
|
32
|
+
* A {@link Collections.ResultMapConverter | ResultMapConverter} which validates keys and values
|
|
33
|
+
* before inserting them into this collection.
|
|
34
|
+
*/
|
|
35
|
+
readonly converting: ResultMapConverter<TK, TV>;
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new {@link Collections.ConvertingResultMap | ConvertingResultMap}.
|
|
38
|
+
* @param params - Required parameters for constructing the map.
|
|
39
|
+
*/
|
|
40
|
+
constructor(params: IConvertingResultMapConstructorParams<TK, TV>);
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new {@link Collections.ConvertingResultMap | ConvertingResultMap} instance.
|
|
43
|
+
* @param params - Required parameters for constructing the map.
|
|
44
|
+
* @returns `Success` with the new map if successful, `Failure` otherwise.
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
static createConvertingResultMap<TK extends string = string, TV = unknown>(params: IConvertingResultMapConstructorParams<TK, TV>): Result<ConvertingResultMap<TK, TV>>;
|
|
48
|
+
/**
|
|
49
|
+
* Gets a read-only version of this map.
|
|
50
|
+
*/
|
|
51
|
+
toReadOnly(): IReadOnlyConvertingResultMap<TK, TV>;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=convertingResultMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertingResultMap.d.ts","sourceRoot":"","sources":["../../../src/packlets/collections/convertingResultMap.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,MAAM,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,4BAA4B,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,OAAO,CACpF,SAAQ,kBAAkB,CAAC,EAAE,EAAE,EAAE,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;CAC1D;AAED;;;GAGG;AACH,MAAM,WAAW,qCAAqC,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,OAAO;IAC7F,OAAO,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,UAAU,EAAE,kBAAkB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;CACxC;AAED;;;;GAIG;AACH,qBAAa,mBAAmB,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,OAAO,CACvE,SAAQ,SAAS,CAAC,EAAE,EAAE,EAAE,CACxB,YAAW,4BAA4B,CAAC,EAAE,EAAE,EAAE,CAAC;IAE/C;;;OAGG;IACH,SAAgB,UAAU,EAAE,kBAAkB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAEvD;;;OAGG;gBACgB,MAAM,EAAE,qCAAqC,CAAC,EAAE,EAAE,EAAE,CAAC;IAMxE;;;;;OAKG;WACW,yBAAyB,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,GAAG,OAAO,EAC9E,MAAM,EAAE,qCAAqC,CAAC,EAAE,EAAE,EAAE,CAAC,GACpD,MAAM,CAAC,mBAAmB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAItC;;OAEG;IACI,UAAU,IAAI,4BAA4B,CAAC,EAAE,EAAE,EAAE,CAAC;CAG1D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.ConvertingResultMap = void 0;
|
|
25
|
+
const base_1 = require("../base");
|
|
26
|
+
const resultMap_1 = require("./resultMap");
|
|
27
|
+
const resultMapConverter_1 = require("./resultMapConverter");
|
|
28
|
+
/**
|
|
29
|
+
* A {@link Collections.ResultMap | ResultMap} with a {@link Collections.ResultMapConverter | validator}
|
|
30
|
+
* property that enables validated use of the underlying map with weakly-typed keys and values.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
class ConvertingResultMap extends resultMap_1.ResultMap {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new {@link Collections.ConvertingResultMap | ConvertingResultMap}.
|
|
36
|
+
* @param params - Required parameters for constructing the map.
|
|
37
|
+
*/
|
|
38
|
+
constructor(params) {
|
|
39
|
+
var _a;
|
|
40
|
+
const entries = params.converters.convertEntries([...((_a = params.entries) !== null && _a !== void 0 ? _a : [])]).orThrow();
|
|
41
|
+
super({ entries });
|
|
42
|
+
this.converting = new resultMapConverter_1.ResultMapConverter({ map: this, converters: params.converters });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new {@link Collections.ConvertingResultMap | ConvertingResultMap} instance.
|
|
46
|
+
* @param params - Required parameters for constructing the map.
|
|
47
|
+
* @returns `Success` with the new map if successful, `Failure` otherwise.
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
static createConvertingResultMap(params) {
|
|
51
|
+
return (0, base_1.captureResult)(() => new ConvertingResultMap(params));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Gets a read-only version of this map.
|
|
55
|
+
*/
|
|
56
|
+
toReadOnly() {
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.ConvertingResultMap = ConvertingResultMap;
|
|
61
|
+
//# sourceMappingURL=convertingResultMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertingResultMap.js","sourceRoot":"","sources":["../../../src/packlets/collections/convertingResultMap.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,kCAAgD;AAIhD,2CAAwC;AACxC,6DAAuF;AAuBvF;;;;GAIG;AACH,MAAa,mBACX,SAAQ,qBAAiB;IASzB;;;OAGG;IACH,YAAmB,MAAqD;;QACtE,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACxF,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QACnB,IAAI,CAAC,UAAU,GAAG,IAAI,uCAAkB,CAAS,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IACjG,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,yBAAyB,CACrC,MAAqD;QAErD,OAAO,IAAA,oBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,UAAU;QACf,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAtCD,kDAsCC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Result } from '../base';\nimport { KeyValueEntry } from './common';\nimport { KeyValueConverters } from './keyValueConverters';\nimport { IReadOnlyResultMap } from './readonlyResultMap';\nimport { ResultMap } from './resultMap';\nimport { IReadOnlyResultMapConverter, ResultMapConverter } from './resultMapConverter';\n\n/**\n * A read-only interface exposing non-mutating methods of a {@link Collections.ConvertingResultMap | ConvertingResultMap}.\n * @public\n */\nexport interface IReadOnlyConvertingResultMap<TK extends string = string, TV = unknown>\n extends IReadOnlyResultMap<TK, TV> {\n /**\n * {@inheritdoc Collections.ConvertingResultMap.converting}\n */\n readonly converting: IReadOnlyResultMapConverter<TK, TV>;\n}\n\n/**\n * Parameters for constructing a {@link Collections.ResultMap | ResultMap}.\n * @public\n */\nexport interface IConvertingResultMapConstructorParams<TK extends string = string, TV = unknown> {\n entries?: Iterable<KeyValueEntry<string, unknown>>;\n converters: KeyValueConverters<TK, TV>;\n}\n\n/**\n * A {@link Collections.ResultMap | ResultMap} with a {@link Collections.ResultMapConverter | validator}\n * property that enables validated use of the underlying map with weakly-typed keys and values.\n * @public\n */\nexport class ConvertingResultMap<TK extends string = string, TV = unknown>\n extends ResultMap<TK, TV>\n implements IReadOnlyConvertingResultMap<TK, TV>\n{\n /**\n * A {@link Collections.ResultMapConverter | ResultMapConverter} which validates keys and values\n * before inserting them into this collection.\n */\n public readonly converting: ResultMapConverter<TK, TV>;\n\n /**\n * Constructs a new {@link Collections.ConvertingResultMap | ConvertingResultMap}.\n * @param params - Required parameters for constructing the map.\n */\n public constructor(params: IConvertingResultMapConstructorParams<TK, TV>) {\n const entries = params.converters.convertEntries([...(params.entries ?? [])]).orThrow();\n super({ entries });\n this.converting = new ResultMapConverter<TK, TV>({ map: this, converters: params.converters });\n }\n\n /**\n * Creates a new {@link Collections.ConvertingResultMap | ConvertingResultMap} instance.\n * @param params - Required parameters for constructing the map.\n * @returns `Success` with the new map if successful, `Failure` otherwise.\n * @public\n */\n public static createConvertingResultMap<TK extends string = string, TV = unknown>(\n params: IConvertingResultMapConstructorParams<TK, TV>\n ): Result<ConvertingResultMap<TK, TV>> {\n return captureResult(() => new ConvertingResultMap(params));\n }\n\n /**\n * Gets a read-only version of this map.\n */\n public toReadOnly(): IReadOnlyConvertingResultMap<TK, TV> {\n return this;\n }\n}\n"]}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import * as Utils from './utils';
|
|
2
|
+
export * from './collectible';
|
|
3
|
+
export * from './collector';
|
|
4
|
+
export * from './collectorConverter';
|
|
5
|
+
export * from './collectors';
|
|
6
|
+
export * from './convertingCollector';
|
|
2
7
|
export * from './common';
|
|
8
|
+
export * from './keyValueConverters';
|
|
3
9
|
export * from './readonlyResultMap';
|
|
4
10
|
export * from './resultMap';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
11
|
+
export * from './resultMapConverter';
|
|
12
|
+
export * from './convertingResultMap';
|
|
7
13
|
export { Utils };
|
|
8
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/collections/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/collections/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -60,9 +60,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
60
60
|
exports.Utils = void 0;
|
|
61
61
|
const Utils = __importStar(require("./utils"));
|
|
62
62
|
exports.Utils = Utils;
|
|
63
|
+
__exportStar(require("./collectible"), exports);
|
|
64
|
+
__exportStar(require("./collector"), exports);
|
|
65
|
+
__exportStar(require("./collectorConverter"), exports);
|
|
66
|
+
__exportStar(require("./collectors"), exports);
|
|
67
|
+
__exportStar(require("./convertingCollector"), exports);
|
|
63
68
|
__exportStar(require("./common"), exports);
|
|
69
|
+
__exportStar(require("./keyValueConverters"), exports);
|
|
64
70
|
__exportStar(require("./readonlyResultMap"), exports);
|
|
65
71
|
__exportStar(require("./resultMap"), exports);
|
|
66
|
-
__exportStar(require("./
|
|
67
|
-
__exportStar(require("./
|
|
72
|
+
__exportStar(require("./resultMapConverter"), exports);
|
|
73
|
+
__exportStar(require("./convertingResultMap"), exports);
|
|
68
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/collections/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/collections/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAiC;AAcxB,sBAAK;AAZd,gDAA8B;AAC9B,8CAA4B;AAC5B,uDAAqC;AACrC,+CAA6B;AAC7B,wDAAsC;AACtC,2CAAyB;AACzB,uDAAqC;AACrC,sDAAoC;AACpC,8CAA4B;AAC5B,uDAAqC;AACrC,wDAAsC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Utils from './utils';\n\nexport * from './collectible';\nexport * from './collector';\nexport * from './collectorConverter';\nexport * from './collectors';\nexport * from './convertingCollector';\nexport * from './common';\nexport * from './keyValueConverters';\nexport * from './readonlyResultMap';\nexport * from './resultMap';\nexport * from './resultMapConverter';\nexport * from './convertingResultMap';\n\nexport { Utils };\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { DetailedResult, Result } from '../base';
|
|
2
|
+
import { Converter, ConverterFunc } from '../conversion';
|
|
3
|
+
import { Validator } from '../validation';
|
|
4
|
+
import { KeyValueEntry } from './common';
|
|
5
|
+
import { ResultMapResultDetail } from './readonlyResultMap';
|
|
6
|
+
/**
|
|
7
|
+
* Parameters for constructing a {@link Collections.KeyValueConverters | KeyValueConverters} instance.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface IKeyValueConverterConstructorParams<TK extends string = string, TV = unknown> {
|
|
11
|
+
/**
|
|
12
|
+
* Required key {@link Validator | validator}, {@link Converter | converter},
|
|
13
|
+
* or {@link Conversion.ConverterFunc | converter function}.
|
|
14
|
+
*/
|
|
15
|
+
key: Validator<TK, unknown> | Converter<TK, unknown> | ConverterFunc<TK, unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Required value {@link Validator | validator}, {@link Converter | converter},
|
|
18
|
+
* or {@link Conversion.ConverterFunc | converter function}.
|
|
19
|
+
*/
|
|
20
|
+
value: Validator<TV, unknown> | Converter<TV, unknown> | ConverterFunc<TV, unknown>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Helper class for converting strongly-typed keys, values, or entries
|
|
24
|
+
* from unknown values.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare class KeyValueConverters<TK extends string = string, TV = unknown> {
|
|
28
|
+
/**
|
|
29
|
+
* Required key {@link Validator | validator} or {@link Converter | converter}.
|
|
30
|
+
*/
|
|
31
|
+
readonly key: Validator<TK, unknown> | Converter<TK, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Required value {@link Validator | validator} or {@link Converter | converter}.
|
|
34
|
+
*/
|
|
35
|
+
readonly value: Validator<TV, unknown> | Converter<TV, unknown>;
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new key-value validator.
|
|
38
|
+
* @param key - Required key {@link Validator | validator}, {@link Converter | converter},
|
|
39
|
+
* or {@link Conversion.ConverterFunc | converter function}.
|
|
40
|
+
* @param value - Required value {@link Validator | validator}, {@link Converter | converter},
|
|
41
|
+
* or {@link Conversion.ConverterFunc | converter function}.
|
|
42
|
+
*/
|
|
43
|
+
constructor({ key, value }: IKeyValueConverterConstructorParams<TK, TV>);
|
|
44
|
+
/**
|
|
45
|
+
* Converts a supplied unknown to a valid key value of type `<TK>`.
|
|
46
|
+
* @param key - The unknown to be converted.
|
|
47
|
+
* @returns `Success` with the converted key value and 'success' detail if the key is valid,
|
|
48
|
+
* or `Failure` with an error message and 'invalid-key' detail if the key is invalid.
|
|
49
|
+
*/
|
|
50
|
+
convertKey(key: unknown): DetailedResult<TK, ResultMapResultDetail>;
|
|
51
|
+
/**
|
|
52
|
+
* Converts a supplied unknown to a valid value of type `<TV>`.
|
|
53
|
+
* @param key - The unknown to be converted.
|
|
54
|
+
* @returns `Success` with the converted value and 'success' detail if the value is valid,
|
|
55
|
+
* or `Failure` with an error message and 'invalid-value' detail if the value is invalid.
|
|
56
|
+
*/
|
|
57
|
+
convertValue(key: unknown): DetailedResult<TV, ResultMapResultDetail>;
|
|
58
|
+
/**
|
|
59
|
+
* Converts a supplied unknown to a valid entry of type `[<TK>, <TV>]`.
|
|
60
|
+
* @param entry - The unknown to be converted.
|
|
61
|
+
* @returns `Success` with the converted entry and 'success' detail if the entry
|
|
62
|
+
* is valid, or `Failure` with an error message and 'invalid-key' or 'invalid-value' detail if
|
|
63
|
+
* the entry is invalid
|
|
64
|
+
*/
|
|
65
|
+
convertEntry(entry: unknown): DetailedResult<KeyValueEntry<TK, TV>, ResultMapResultDetail>;
|
|
66
|
+
/**
|
|
67
|
+
* Converts a supplied iterable of unknowns to valid key-value pairs.
|
|
68
|
+
* @param entries - The iterable of unknowns to be converted.
|
|
69
|
+
* @returns `Success` with an array of converted key-value pairs if all entries are valid,
|
|
70
|
+
* or `Failure` with an error message if any entry is invalid.
|
|
71
|
+
*/
|
|
72
|
+
convertEntries(entries: Iterable<unknown>): Result<KeyValueEntry<TK, TV>[]>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=keyValueConverters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyValueConverters.d.ts","sourceRoot":"","sources":["../../../src/packlets/collections/keyValueConverters.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,cAAc,EAGd,MAAM,EAGP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAc,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,mCAAmC,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,GAA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