@grafctory/blue 0.0.0-stage → 0.16.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/LICENSE +201 -0
- package/README.md +524 -2
- package/dist/boolean/assembler.d.ts +53 -0
- package/dist/boolean/assembler.d.ts.map +1 -0
- package/dist/boolean/assembler.js +78 -0
- package/dist/boolean/assembler.js.map +1 -0
- package/dist/boolean/index.d.ts +86 -0
- package/dist/boolean/index.d.ts.map +1 -0
- package/dist/boolean/index.js +99 -0
- package/dist/boolean/index.js.map +1 -0
- package/dist/boolean/validator.d.ts +30 -0
- package/dist/boolean/validator.d.ts.map +1 -0
- package/dist/boolean/validator.js +68 -0
- package/dist/boolean/validator.js.map +1 -0
- package/dist/dictionary/assembler.d.ts +70 -0
- package/dist/dictionary/assembler.d.ts.map +1 -0
- package/dist/dictionary/assembler.js +178 -0
- package/dist/dictionary/assembler.js.map +1 -0
- package/dist/dictionary/index.d.ts +237 -0
- package/dist/dictionary/index.d.ts.map +1 -0
- package/dist/dictionary/index.js +43 -0
- package/dist/dictionary/index.js.map +1 -0
- package/dist/dictionary/inference.d.ts +42 -0
- package/dist/dictionary/inference.d.ts.map +1 -0
- package/dist/dictionary/inference.js +17 -0
- package/dist/dictionary/inference.js.map +1 -0
- package/dist/dictionary/validator.d.ts +37 -0
- package/dist/dictionary/validator.d.ts.map +1 -0
- package/dist/dictionary/validator.js +106 -0
- package/dist/dictionary/validator.js.map +1 -0
- package/dist/index.core.d.ts +33 -0
- package/dist/index.core.d.ts.map +1 -0
- package/dist/index.core.js +149 -0
- package/dist/index.core.js.map +1 -0
- package/dist/index.d.ts +333 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +378 -0
- package/dist/index.js.map +1 -0
- package/dist/number/assembler.d.ts +70 -0
- package/dist/number/assembler.d.ts.map +1 -0
- package/dist/number/assembler.js +188 -0
- package/dist/number/assembler.js.map +1 -0
- package/dist/number/index.d.ts +329 -0
- package/dist/number/index.d.ts.map +1 -0
- package/dist/number/index.js +312 -0
- package/dist/number/index.js.map +1 -0
- package/dist/number/validator.d.ts +31 -0
- package/dist/number/validator.d.ts.map +1 -0
- package/dist/number/validator.js +57 -0
- package/dist/number/validator.js.map +1 -0
- package/dist/reference/accessors.d.ts +29 -0
- package/dist/reference/accessors.d.ts.map +1 -0
- package/dist/reference/accessors.js +38 -0
- package/dist/reference/accessors.js.map +1 -0
- package/dist/reference/assembler.d.ts +63 -0
- package/dist/reference/assembler.d.ts.map +1 -0
- package/dist/reference/assembler.js +127 -0
- package/dist/reference/assembler.js.map +1 -0
- package/dist/reference/index.d.ts +108 -0
- package/dist/reference/index.d.ts.map +1 -0
- package/dist/reference/index.js +40 -0
- package/dist/reference/index.js.map +1 -0
- package/dist/reference/validator.d.ts +33 -0
- package/dist/reference/validator.d.ts.map +1 -0
- package/dist/reference/validator.js +56 -0
- package/dist/reference/validator.js.map +1 -0
- package/dist/resource/accessors.d.ts +140 -0
- package/dist/resource/accessors.d.ts.map +1 -0
- package/dist/resource/accessors.js +173 -0
- package/dist/resource/accessors.js.map +1 -0
- package/dist/resource/assembler.d.ts +265 -0
- package/dist/resource/assembler.d.ts.map +1 -0
- package/dist/resource/assembler.js +816 -0
- package/dist/resource/assembler.js.map +1 -0
- package/dist/resource/index.d.ts +903 -0
- package/dist/resource/index.d.ts.map +1 -0
- package/dist/resource/index.js +160 -0
- package/dist/resource/index.js.map +1 -0
- package/dist/resource/inference.d.ts +310 -0
- package/dist/resource/inference.d.ts.map +1 -0
- package/dist/resource/inference.js +17 -0
- package/dist/resource/inference.js.map +1 -0
- package/dist/resource/validator.d.ts +158 -0
- package/dist/resource/validator.d.ts.map +1 -0
- package/dist/resource/validator.js +1013 -0
- package/dist/resource/validator.js.map +1 -0
- package/dist/string/assembler.d.ts +69 -0
- package/dist/string/assembler.d.ts.map +1 -0
- package/dist/string/assembler.js +143 -0
- package/dist/string/assembler.js.map +1 -0
- package/dist/string/index.d.ts +431 -0
- package/dist/string/index.d.ts.map +1 -0
- package/dist/string/index.js +528 -0
- package/dist/string/index.js.map +1 -0
- package/dist/string/validator.d.ts +30 -0
- package/dist/string/validator.d.ts.map +1 -0
- package/dist/string/validator.js +69 -0
- package/dist/string/validator.js.map +1 -0
- package/dist/union/accessors.d.ts +137 -0
- package/dist/union/accessors.d.ts.map +1 -0
- package/dist/union/accessors.js +253 -0
- package/dist/union/accessors.js.map +1 -0
- package/dist/union/assembler.d.ts +56 -0
- package/dist/union/assembler.d.ts.map +1 -0
- package/dist/union/assembler.js +140 -0
- package/dist/union/assembler.js.map +1 -0
- package/dist/union/index.d.ts +172 -0
- package/dist/union/index.d.ts.map +1 -0
- package/dist/union/index.js +45 -0
- package/dist/union/index.js.map +1 -0
- package/dist/union/inference.d.ts +30 -0
- package/dist/union/inference.d.ts.map +1 -0
- package/dist/union/inference.js +17 -0
- package/dist/union/inference.js.map +1 -0
- package/dist/union/validator.d.ts +94 -0
- package/dist/union/validator.d.ts.map +1 -0
- package/dist/union/validator.js +171 -0
- package/dist/union/validator.js.map +1 -0
- package/dist/value/accessors.d.ts +151 -0
- package/dist/value/accessors.d.ts.map +1 -0
- package/dist/value/accessors.js +468 -0
- package/dist/value/accessors.js.map +1 -0
- package/dist/value/assembler.d.ts +129 -0
- package/dist/value/assembler.d.ts.map +1 -0
- package/dist/value/assembler.js +248 -0
- package/dist/value/assembler.js.map +1 -0
- package/dist/value/index.d.ts +309 -0
- package/dist/value/index.d.ts.map +1 -0
- package/dist/value/index.js +26 -0
- package/dist/value/index.js.map +1 -0
- package/dist/value/inference.d.ts +292 -0
- package/dist/value/inference.d.ts.map +1 -0
- package/dist/value/inference.js +17 -0
- package/dist/value/inference.js.map +1 -0
- package/dist/value/validator.d.ts +76 -0
- package/dist/value/validator.d.ts.map +1 -0
- package/dist/value/validator.js +111 -0
- package/dist/value/validator.js.map +1 -0
- package/package.json +95 -4
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Legal } from "../value/inference.js";
|
|
2
|
+
/**
|
|
3
|
+
* Describes a truth value.
|
|
4
|
+
*
|
|
5
|
+
* Admits the [JSON booleans](https://datatracker.ietf.org/doc/html/rfc8259#section-3) a resource may carry, closed to
|
|
6
|
+
* a single one where the shape enumerates it and typed as an
|
|
7
|
+
* [XSD 1.0](https://www.w3.org/TR/xmlschema-2/#built-in-datatypes) boolean, so that a validated value carries the
|
|
8
|
+
* datatype the shape states rather than the one JSON leaves unsaid.
|
|
9
|
+
*
|
|
10
|
+
* **Inheritance**
|
|
11
|
+
*
|
|
12
|
+
* Where a {@link resource!ResourceShape} extends the shapes it lists as `parents`, boolean-valued members are merged
|
|
13
|
+
* according to the following rules. The *child* is the extending shape; the *parent* is the inherited one.
|
|
14
|
+
*
|
|
15
|
+
* | Field | Override Rule |
|
|
16
|
+
* | ------ | ----------------------------------------------------------------------------------- |
|
|
17
|
+
* | `kind` | Cannot be overridden |
|
|
18
|
+
* | `in` | Must be strictly equal when both defined; the single defined value carries through |
|
|
19
|
+
*
|
|
20
|
+
* A child restating the value its parent admits narrows nothing and is accepted all the same; a child admitting the
|
|
21
|
+
* other value would leave the member admitting nothing and is rejected.
|
|
22
|
+
*
|
|
23
|
+
* @typeParam V The values the shape admits, narrowed to the enumerated one where it states an
|
|
24
|
+
* {@link BooleanConstraints.in | enumeration} and both truth values otherwise
|
|
25
|
+
*
|
|
26
|
+
* @see {@link https://www.w3.org/TR/xmlschema-2/#boolean XSD 1.0 Part 2: Datatypes § 3.2.2 boolean}
|
|
27
|
+
*/
|
|
28
|
+
export type BooleanShape<V extends boolean = boolean> = BooleanConstraints<V> & {
|
|
29
|
+
/**
|
|
30
|
+
* Discriminator identifying this as a boolean shape.
|
|
31
|
+
*
|
|
32
|
+
* **Inheritance** — cannot be overridden.
|
|
33
|
+
*/
|
|
34
|
+
readonly kind: "boolean";
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Constraints accepted by the {@link boolean} shape factory.
|
|
38
|
+
*
|
|
39
|
+
* @typeParam V The value the enumeration admits
|
|
40
|
+
*/
|
|
41
|
+
export type BooleanConstraints<V extends boolean = boolean> = {
|
|
42
|
+
/**
|
|
43
|
+
* Allowed value (closed enumeration).
|
|
44
|
+
*
|
|
45
|
+
* When specified, values must be equal to it. The domain holds two values, so the constraint states the single
|
|
46
|
+
* admitted one rather than a list, which would either readmit the whole domain or close it to nothing; the
|
|
47
|
+
* {@link boolean} factory takes it as a bare value too. Closing the domain also narrows the value the shape
|
|
48
|
+
* describes to the stated one, wherever it is stated precisely enough to be told apart; a value only known to be a
|
|
49
|
+
* boolean leaves the shape admitting both.
|
|
50
|
+
*
|
|
51
|
+
* **Inheritance** — must be strictly equal when both parent and child define it; otherwise the single defined value
|
|
52
|
+
* carries through. A mismatch is reported as an error.
|
|
53
|
+
*
|
|
54
|
+
* @defaultValue `undefined` (both truth values admitted)
|
|
55
|
+
*
|
|
56
|
+
* @see {@link https://www.w3.org/TR/shacl/#InConstraintComponent SHACL § 4.8.3 sh:in}
|
|
57
|
+
*/
|
|
58
|
+
readonly in?: V;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Creates a boolean shape.
|
|
62
|
+
*
|
|
63
|
+
* Admits `true` and `false` and nothing else, closed to the single enumerated value where the constraints state one;
|
|
64
|
+
* the domain is closed by the kind alone, so the constraints cannot be contradictory.
|
|
65
|
+
*
|
|
66
|
+
* @typeParam C The stated constraints
|
|
67
|
+
*
|
|
68
|
+
* @param constraints Optional shape {@link BooleanConstraints constraints}
|
|
69
|
+
*
|
|
70
|
+
* @returns An immutable shape admitting truth values, narrowed to the value the constraints enumerate
|
|
71
|
+
*/
|
|
72
|
+
export declare function boolean<const C extends BooleanConstraints = {}>(constraints?: C): BooleanShape<Legal<C, boolean>>;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a boolean shape admitting a single value.
|
|
75
|
+
*
|
|
76
|
+
* Reads a bare truth value as the enumeration closing the domain to it, so that a tag telling the alternatives of a
|
|
77
|
+
* union apart is stated as `boolean(true)` rather than as `boolean({ in: true })`.
|
|
78
|
+
*
|
|
79
|
+
* @typeParam V The value the shape admits
|
|
80
|
+
*
|
|
81
|
+
* @param value The single admitted truth value
|
|
82
|
+
*
|
|
83
|
+
* @returns An immutable shape admitting `value` alone
|
|
84
|
+
*/
|
|
85
|
+
export declare function boolean<const V extends boolean>(value: V): BooleanShape<V>;
|
|
86
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/boolean/index.ts"],"names":[],"mappings":"AA6FA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAAG;IAE/E;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAExB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI;IAE7D;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CAEhB,CAAA;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,kBAAkB,GAAG,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAEnH;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2025-2026 Metreeca srl
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Boolean shape types and operations.
|
|
18
|
+
*
|
|
19
|
+
* Defines the shape describing the truth values a resource may carry and provides the {@link boolean} factory stating
|
|
20
|
+
* it, mapping the [JSON boolean](https://datatracker.ietf.org/doc/html/rfc8259#section-3) type to the
|
|
21
|
+
* [XSD 1.0](https://www.w3.org/TR/xmlschema-2/#built-in-datatypes) boolean datatype. The kind closes the domain to two
|
|
22
|
+
* values; an enumeration closes it further to one, so that a member may stand as the tag telling the alternatives of a
|
|
23
|
+
* union apart.
|
|
24
|
+
*
|
|
25
|
+
* | XSD Datatype ¹ | Factory | Description | Range |
|
|
26
|
+
* | -------------- | --------------- | ------------------- | ------------- |
|
|
27
|
+
* | [boolean][] | {@link boolean} | binary-valued logic | {true, false} |
|
|
28
|
+
*
|
|
29
|
+
* [boolean]: https://www.w3.org/TR/xmlschema-2/#boolean
|
|
30
|
+
*
|
|
31
|
+
* ¹ XSD 1.0 datatypes are referenced by [RDF 1.1](https://www.w3.org/TR/rdf11-concepts/) and
|
|
32
|
+
* [JSON-LD 1.1](https://www.w3.org/TR/json-ld11/) as normative
|
|
33
|
+
*
|
|
34
|
+
* **Compatibility**
|
|
35
|
+
*
|
|
36
|
+
* | JSON | XSD | JavaScript |
|
|
37
|
+
* | --------------- | ------------------------------ | --------------- |
|
|
38
|
+
* | `true`, `false` | {true, false, 1, 0} ¹ | `true`, `false` |
|
|
39
|
+
*
|
|
40
|
+
* ¹ Canonical form: `true`, `false`
|
|
41
|
+
*
|
|
42
|
+
* **Defining boolean shapes**
|
|
43
|
+
*
|
|
44
|
+
* ```typescript
|
|
45
|
+
* import { boolean } from '@grafctory/blue/boolean';
|
|
46
|
+
*
|
|
47
|
+
* const flag = boolean(); // either truth value
|
|
48
|
+
* const settled = boolean({ in: true }); // the single admitted value
|
|
49
|
+
* const paid = boolean(true); // the same, stated as a bare value
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* > [!NOTE]
|
|
53
|
+
* > An enumeration also narrows the value the shape describes: `settled` admits `true`, not both truth values. The
|
|
54
|
+
* > domain holds two values, so the constraint states the single admitted one: a list would degenerate, admitting
|
|
55
|
+
* > either the whole domain or nothing at all.
|
|
56
|
+
*
|
|
57
|
+
* **Using in resource shapes**
|
|
58
|
+
*
|
|
59
|
+
* ```typescript
|
|
60
|
+
* import { optional, required, resource } from '@grafctory/blue/resource';
|
|
61
|
+
* import { boolean } from '@grafctory/blue/boolean';
|
|
62
|
+
*
|
|
63
|
+
* const Product = resource({
|
|
64
|
+
* available: required(boolean()),
|
|
65
|
+
* featured: optional(boolean())
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* **Tagging the alternatives of a union**
|
|
70
|
+
*
|
|
71
|
+
* ```typescript
|
|
72
|
+
* import { boolean } from '@grafctory/blue/boolean';
|
|
73
|
+
* import { date } from '@grafctory/blue/string';
|
|
74
|
+
* import { required, resource } from '@grafctory/blue/resource';
|
|
75
|
+
* import { union } from '@grafctory/blue/union';
|
|
76
|
+
*
|
|
77
|
+
* const Payment = union(
|
|
78
|
+
* resource({ settled: required(boolean(false)), due: required(date()) }),
|
|
79
|
+
* resource({ settled: required(boolean(true)), paid: required(date()) })
|
|
80
|
+
* );
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* A stored value states one truth value, singling out the alternative it belongs to, and the type of the value the
|
|
84
|
+
* union describes is narrowed by the tag exactly as the shape is.
|
|
85
|
+
*
|
|
86
|
+
* @module
|
|
87
|
+
*
|
|
88
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc8259#section-3 RFC 8259 § 3 Values}
|
|
89
|
+
* @see {@link https://www.w3.org/TR/xmlschema-2/#boolean XSD 1.0 Part 2: Datatypes § 3.2.2 boolean}
|
|
90
|
+
*/
|
|
91
|
+
import { isBoolean } from "@grafctory/core";
|
|
92
|
+
import { assemble } from "./assembler.js";
|
|
93
|
+
/**
|
|
94
|
+
* Creates a boolean shape.
|
|
95
|
+
*/
|
|
96
|
+
export function boolean(constraints) {
|
|
97
|
+
return assemble(isBoolean(constraints) ? { in: constraints } : { ...constraints });
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/boolean/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAkG1C;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,WAA0C;IAEjE,OAAO,QAAQ,CAAU,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC;AAE7F,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boolean value validation.
|
|
3
|
+
*
|
|
4
|
+
* Holds a value to what a boolean shape admits and reports everything wrong with it at once, keyed by the facet at
|
|
5
|
+
* fault, at the strictness the caller asks for: a stored value or a retrieval placeholder.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { type Optional } from "@grafctory/core";
|
|
10
|
+
import { type Trace } from "@grafctory/core/trace";
|
|
11
|
+
import { type Scope } from "../value/validator.js";
|
|
12
|
+
import type { BooleanShape } from "./index.js";
|
|
13
|
+
/**
|
|
14
|
+
* Validates values against a boolean shape.
|
|
15
|
+
*
|
|
16
|
+
* Reports each value that is not a boolean as a `{type}` violation and each boolean the enumeration leaves out under
|
|
17
|
+
* its own facet, keying every element violation by its index, so that a caller may tell which value failed and why.
|
|
18
|
+
*
|
|
19
|
+
* @param values The values to validate
|
|
20
|
+
* @param shape The shape the values are matched against
|
|
21
|
+
* @param opts Validation options
|
|
22
|
+
* @param opts.scope The {@link Scope | strictness} the shape is enforced at, defaulting to `"state"`. `"model"` admits
|
|
23
|
+
* the atomic placeholder
|
|
24
|
+
*
|
|
25
|
+
* @returns A trace of the violations found, or `undefined` where every value matches `shape`
|
|
26
|
+
*/
|
|
27
|
+
export declare const validateBoolean: (values: readonly unknown[], shape: BooleanShape, opts?: {
|
|
28
|
+
scope?: Scope;
|
|
29
|
+
}) => Optional<Trace>;
|
|
30
|
+
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/boolean/validator.ts"],"names":[],"mappings":"AAiBA;;;;;;;GAOG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAe,KAAK,KAAK,EAAwB,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,KAAK,KAAK,EAAU,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE;IAEtF,KAAK,CAAC,EAAE,KAAK,CAAA;CAEb,KAAK,QAAQ,CAAC,KAAK,CAAwB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2025-2026 Metreeca srl
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Boolean value validation.
|
|
18
|
+
*
|
|
19
|
+
* Holds a value to what a boolean shape admits and reports everything wrong with it at once, keyed by the facet at
|
|
20
|
+
* fault, at the strictness the caller asks for: a stored value or a retrieval placeholder.
|
|
21
|
+
*
|
|
22
|
+
* @module
|
|
23
|
+
*/
|
|
24
|
+
import { isBoolean } from "@grafctory/core";
|
|
25
|
+
import { isAtomic } from "@grafctory/qest/model";
|
|
26
|
+
import { array, pass, type } from "@grafctory/core/trace";
|
|
27
|
+
import { scoped } from "../value/validator.js";
|
|
28
|
+
/**
|
|
29
|
+
* Validates values against a boolean shape.
|
|
30
|
+
*
|
|
31
|
+
* Reports each value that is not a boolean as a `{type}` violation and each boolean the enumeration leaves out under
|
|
32
|
+
* its own facet, keying every element violation by its index, so that a caller may tell which value failed and why.
|
|
33
|
+
*
|
|
34
|
+
* @param values The values to validate
|
|
35
|
+
* @param shape The shape the values are matched against
|
|
36
|
+
* @param opts Validation options
|
|
37
|
+
* @param opts.scope The {@link Scope | strictness} the shape is enforced at, defaulting to `"state"`. `"model"` admits
|
|
38
|
+
* the atomic placeholder
|
|
39
|
+
*
|
|
40
|
+
* @returns A trace of the violations found, or `undefined` where every value matches `shape`
|
|
41
|
+
*/
|
|
42
|
+
export const validateBoolean = scoped(state, model);
|
|
43
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
44
|
+
/**
|
|
45
|
+
* Every constraint: a legal element of the shape's domain.
|
|
46
|
+
*/
|
|
47
|
+
function state({ in: allowed }) {
|
|
48
|
+
return array(type(isBoolean, domain(allowed)));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The form alone: a retrieval placeholder asks for the value as it stands and carries none of its own.
|
|
52
|
+
*/
|
|
53
|
+
function model({}) {
|
|
54
|
+
return array(type(isAtomic));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Matches a boolean against the value a shape enumerates, admitting both truth values where it enumerates none.
|
|
58
|
+
*/
|
|
59
|
+
function domain(allowed) {
|
|
60
|
+
if (allowed === undefined) {
|
|
61
|
+
return pass;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
const outside = [`{domain} expected value in [${allowed}]`];
|
|
65
|
+
return value => value === allowed ? undefined : outside;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/boolean/validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAc,IAAI,EAAkB,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAc,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI3D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,eAAe,GAIJ,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAG7C,wHAAwH;AAExH;;GAEG;AACH,SAAS,KAAK,CAAC,EAEd,EAAE,EAAE,OAAO,EAEG;IAEd,OAAO,KAAK,CACX,IAAI,CAAC,SAAS,EACb,MAAM,CAAC,OAAO,CAAC,CACf,CACD,CAAC;AAEH,CAAC;AAED;;GAEG;AACH,SAAS,KAAK,CAAC,EAAgB;IAE9B,OAAO,KAAK,CACX,IAAI,CAAC,QAAQ,CAAC,CACd,CAAC;AAEH,CAAC;AAED;;GAEG;AACH,SAAS,MAAM,CAAC,OAA0B;IAEzC,IAAK,OAAO,KAAK,SAAS,EAAG,CAAC;QAE7B,OAAO,IAAI,CAAC;IAEb,CAAC;SAAM,CAAC;QAEP,MAAM,OAAO,GAAG,CAAC,+BAA+B,OAAO,GAAG,CAAC,CAAC;QAE5D,OAAO,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;IAEzD,CAAC;AAEF,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dictionary shape assembly.
|
|
3
|
+
*
|
|
4
|
+
* Builds the shape the factory states into the form its consumers read, and combines it with the one it overrides: a
|
|
5
|
+
* shape admitting no value at all is rejected as it is built rather than when a value is first matched against it, and
|
|
6
|
+
* an extension is held to the shape it refines before either is committed to.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { type Optional } from "@grafctory/core";
|
|
11
|
+
import { type Trace } from "@grafctory/core/trace";
|
|
12
|
+
import { type DictionaryConstraints, type DictionaryShape } from "./index.js";
|
|
13
|
+
/**
|
|
14
|
+
* Assembles a dictionary shape.
|
|
15
|
+
*
|
|
16
|
+
* Backs the factory the {@link dictionary!} module exposes: contradictory constraints are rejected as the shape is
|
|
17
|
+
* built, so that a shape that exists admits at least one value.
|
|
18
|
+
*
|
|
19
|
+
* @typeParam U The per-tag arity the shape states, as stated by the signature of the calling factory
|
|
20
|
+
*
|
|
21
|
+
* @param constraints The stated shape {@link DictionaryConstraints constraints}
|
|
22
|
+
*
|
|
23
|
+
* @returns An immutable shape admitting the language maps the constraints bound
|
|
24
|
+
*
|
|
25
|
+
* @throws {@link @grafctory/core!TraceError | TraceError} Where the stated constraints contradict one another
|
|
26
|
+
*/
|
|
27
|
+
export declare function assemble<U extends undefined | boolean>(constraints: DictionaryConstraints): DictionaryShape & {
|
|
28
|
+
readonly uniqueLang: U;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Checks a set of localised constraints for internal consistency.
|
|
32
|
+
*
|
|
33
|
+
* Reports the contradictions that would leave a shape admitting no value at all, so that a shape is rejected as it is
|
|
34
|
+
* built rather than when a value is first matched against it.
|
|
35
|
+
*
|
|
36
|
+
* @param constraints The constraints to check
|
|
37
|
+
*
|
|
38
|
+
* @returns A trace of the inconsistencies found, or `undefined` where the constraints admit at least one value
|
|
39
|
+
*/
|
|
40
|
+
export declare function checkDictionary(constraints: DictionaryConstraints): Optional<Trace>;
|
|
41
|
+
/**
|
|
42
|
+
* Tells whether a dictionary shape narrows an inherited one.
|
|
43
|
+
*
|
|
44
|
+
* Tests the override relation without building the merged shape, so that an incompatible extension is told apart from
|
|
45
|
+
* a legitimate refinement before either is committed to: a shape narrows the inherited one where it leaves neither
|
|
46
|
+
* length bound wider, adds no language range the inherited shape omits, drops no required one, keeps its per-tag
|
|
47
|
+
* arity, and yields a consistent set of merged constraints, so that the merged shape still admits some value.
|
|
48
|
+
*
|
|
49
|
+
* @param target The overriding shape
|
|
50
|
+
* @param source The inherited shape
|
|
51
|
+
*
|
|
52
|
+
* @returns A trace of the obstacles to the override, or `undefined` where `target` narrows `source`
|
|
53
|
+
*/
|
|
54
|
+
export declare function narrowsDictionary(target: DictionaryShape, source: DictionaryShape): Optional<Trace>;
|
|
55
|
+
/**
|
|
56
|
+
* Merges a dictionary shape with an inherited one.
|
|
57
|
+
*
|
|
58
|
+
* Yields the single shape an extending member is validated against, combining the inherited constraints with the
|
|
59
|
+
* overriding ones: length bounds accumulate, the accepted language ranges intersect, the required ones add up, and
|
|
60
|
+
* `uniqueLang` carries through from whichever shape states it, so that an arity the parent fixes is never lost.
|
|
61
|
+
*
|
|
62
|
+
* @param target The overriding shape
|
|
63
|
+
* @param source The inherited shape
|
|
64
|
+
*
|
|
65
|
+
* @returns An immutable shape admitting the language maps both `target` and `source` admit
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link @grafctory/core!TraceError | TraceError} Where `target` doesn't narrow `source`
|
|
68
|
+
*/
|
|
69
|
+
export declare function mergeDictionary(target: DictionaryShape, source: DictionaryShape): DictionaryShape;
|
|
70
|
+
//# sourceMappingURL=assembler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembler.d.ts","sourceRoot":"","sources":["../../src/dictionary/assembler.ts"],"names":[],"mappings":"AAiBA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAG9E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,GAAG,OAAO,EAAE,WAAW,EAAE,qBAAqB,GAAG,eAAe,GAAG;IAC9G,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAA;CACtB,CAcA;AAKD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,qBAAqB,GAAG,QAAQ,CAAC,KAAK,CAAC,CAsBnF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,CAInG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe,CAcjG"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2025-2026 Metreeca srl
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { immutable } from "@grafctory/core/values";
|
|
17
|
+
import { all, test } from "@grafctory/core/trace";
|
|
18
|
+
import { reject } from "../value/assembler.js";
|
|
19
|
+
/**
|
|
20
|
+
* Assembles a dictionary shape.
|
|
21
|
+
*
|
|
22
|
+
* Backs the factory the {@link dictionary!} module exposes: contradictory constraints are rejected as the shape is
|
|
23
|
+
* built, so that a shape that exists admits at least one value.
|
|
24
|
+
*
|
|
25
|
+
* @typeParam U The per-tag arity the shape states, as stated by the signature of the calling factory
|
|
26
|
+
*
|
|
27
|
+
* @param constraints The stated shape {@link DictionaryConstraints constraints}
|
|
28
|
+
*
|
|
29
|
+
* @returns An immutable shape admitting the language maps the constraints bound
|
|
30
|
+
*
|
|
31
|
+
* @throws {@link @grafctory/core!TraceError | TraceError} Where the stated constraints contradict one another
|
|
32
|
+
*/
|
|
33
|
+
export function assemble(constraints) {
|
|
34
|
+
const shape = immutable({
|
|
35
|
+
kind: "dictionary",
|
|
36
|
+
...constraints
|
|
37
|
+
}); // ;(cast) the factory signature fixes the stated arity
|
|
38
|
+
reject("inconsistent dictionary shape constraints", checkDictionary(shape));
|
|
39
|
+
return shape;
|
|
40
|
+
}
|
|
41
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
42
|
+
/**
|
|
43
|
+
* Checks a set of localised constraints for internal consistency.
|
|
44
|
+
*
|
|
45
|
+
* Reports the contradictions that would leave a shape admitting no value at all, so that a shape is rejected as it is
|
|
46
|
+
* built rather than when a value is first matched against it.
|
|
47
|
+
*
|
|
48
|
+
* @param constraints The constraints to check
|
|
49
|
+
*
|
|
50
|
+
* @returns A trace of the inconsistencies found, or `undefined` where the constraints admit at least one value
|
|
51
|
+
*/
|
|
52
|
+
export function checkDictionary(constraints) {
|
|
53
|
+
return all(test(({ minLength, maxLength }) => {
|
|
54
|
+
return minLength === undefined || maxLength === undefined || minLength <= maxLength || [
|
|
55
|
+
`{minLength/maxLength} inconsistent bounds <${minLength}> > <${maxLength}>`
|
|
56
|
+
];
|
|
57
|
+
}), test(({ languageIn: accepted = [], hasLanguage: required = [] }) => {
|
|
58
|
+
const unmatched = accepted.length === 0 ? []
|
|
59
|
+
: required.filter(range => !accepted.some(admitted => overlaps(range, admitted)));
|
|
60
|
+
return unmatched.length === 0 || [
|
|
61
|
+
`{hasLanguage/languageIn} required ranges <${unmatched}> not matched by any accepted range`
|
|
62
|
+
];
|
|
63
|
+
}))(constraints);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Tells whether a dictionary shape narrows an inherited one.
|
|
67
|
+
*
|
|
68
|
+
* Tests the override relation without building the merged shape, so that an incompatible extension is told apart from
|
|
69
|
+
* a legitimate refinement before either is committed to: a shape narrows the inherited one where it leaves neither
|
|
70
|
+
* length bound wider, adds no language range the inherited shape omits, drops no required one, keeps its per-tag
|
|
71
|
+
* arity, and yields a consistent set of merged constraints, so that the merged shape still admits some value.
|
|
72
|
+
*
|
|
73
|
+
* @param target The overriding shape
|
|
74
|
+
* @param source The inherited shape
|
|
75
|
+
*
|
|
76
|
+
* @returns A trace of the obstacles to the override, or `undefined` where `target` narrows `source`
|
|
77
|
+
*/
|
|
78
|
+
export function narrowsDictionary(target, source) {
|
|
79
|
+
return narrows(target, source, merge(target, source));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Merges a dictionary shape with an inherited one.
|
|
83
|
+
*
|
|
84
|
+
* Yields the single shape an extending member is validated against, combining the inherited constraints with the
|
|
85
|
+
* overriding ones: length bounds accumulate, the accepted language ranges intersect, the required ones add up, and
|
|
86
|
+
* `uniqueLang` carries through from whichever shape states it, so that an arity the parent fixes is never lost.
|
|
87
|
+
*
|
|
88
|
+
* @param target The overriding shape
|
|
89
|
+
* @param source The inherited shape
|
|
90
|
+
*
|
|
91
|
+
* @returns An immutable shape admitting the language maps both `target` and `source` admit
|
|
92
|
+
*
|
|
93
|
+
* @throws {@link @grafctory/core!TraceError | TraceError} Where `target` doesn't narrow `source`
|
|
94
|
+
*/
|
|
95
|
+
export function mergeDictionary(target, source) {
|
|
96
|
+
const merged = merge(target, source);
|
|
97
|
+
reject("incompatible dictionary shape override", narrows(target, source, merged));
|
|
98
|
+
return immutable({
|
|
99
|
+
kind: "dictionary",
|
|
100
|
+
...merged
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
104
|
+
/**
|
|
105
|
+
* Reports the obstacles standing against a dictionary shape override.
|
|
106
|
+
*
|
|
107
|
+
* @param target The overriding shape
|
|
108
|
+
* @param source The inherited shape
|
|
109
|
+
* @param merged The constraints the two shapes combine into
|
|
110
|
+
*
|
|
111
|
+
* @returns A trace of the obstacles to the override, or `undefined` where `target` narrows `source`
|
|
112
|
+
*/
|
|
113
|
+
function narrows(target, source, merged) {
|
|
114
|
+
const { languageIn: accepted, hasLanguage: required = [] } = source;
|
|
115
|
+
return all(test(({ uniqueLang }) => {
|
|
116
|
+
return uniqueLang !== false || source.uniqueLang !== true || [
|
|
117
|
+
`{uniqueLang} dropped unique language constraint`
|
|
118
|
+
];
|
|
119
|
+
}), test(({ minLength }) => {
|
|
120
|
+
return minLength === undefined || source.minLength === undefined || minLength >= source.minLength || [
|
|
121
|
+
`{minLength} widened limit <${minLength}> beyond <${source.minLength}>`
|
|
122
|
+
];
|
|
123
|
+
}), test(({ maxLength }) => {
|
|
124
|
+
return maxLength === undefined || source.maxLength === undefined || maxLength <= source.maxLength || [
|
|
125
|
+
`{maxLength} widened limit <${maxLength}> beyond <${source.maxLength}>`
|
|
126
|
+
];
|
|
127
|
+
}), test(({ languageIn }) => {
|
|
128
|
+
// a range the parent omits would be intersected away, leaving the state wider than the shape admits,
|
|
129
|
+
// so a widened set is rejected outright as with the bounds
|
|
130
|
+
const unexpected = languageIn === undefined || accepted === undefined ? []
|
|
131
|
+
: languageIn.filter(v => !accepted.includes(v));
|
|
132
|
+
return unexpected.length === 0 || [
|
|
133
|
+
`{languageIn} unexpected ranges [${unexpected}]`
|
|
134
|
+
];
|
|
135
|
+
}), test(({ hasLanguage }) => {
|
|
136
|
+
const missing = hasLanguage === undefined ? [] : required.filter(v => !hasLanguage.includes(v));
|
|
137
|
+
return missing.length === 0 || [
|
|
138
|
+
`{hasLanguage} missing required ranges [${missing}]`
|
|
139
|
+
];
|
|
140
|
+
}), () => checkDictionary(merged) // post-merge constraint consistency
|
|
141
|
+
)(target);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Combines the constraints of an overriding shape with the inherited ones.
|
|
145
|
+
*
|
|
146
|
+
* @param target The overriding shape
|
|
147
|
+
* @param source The inherited shape
|
|
148
|
+
*
|
|
149
|
+
* @returns The merged constraints, as they stand before they are checked for consistency
|
|
150
|
+
*/
|
|
151
|
+
function merge(target, source) {
|
|
152
|
+
const { languageIn: accepted, hasLanguage: required } = source;
|
|
153
|
+
return {
|
|
154
|
+
// conjunctive: uniqueLang — added but never dropped
|
|
155
|
+
uniqueLang: target.uniqueLang ?? source.uniqueLang,
|
|
156
|
+
// conjunctive: lengths — the tighter bound
|
|
157
|
+
minLength: target.minLength ?? source.minLength,
|
|
158
|
+
maxLength: target.maxLength ?? source.maxLength,
|
|
159
|
+
// conjunctive: languageIn — intersection
|
|
160
|
+
languageIn: target.languageIn !== undefined && accepted !== undefined
|
|
161
|
+
? target.languageIn.filter(v => accepted.includes(v))
|
|
162
|
+
: target.languageIn ?? accepted,
|
|
163
|
+
// conjunctive: hasLanguage — union
|
|
164
|
+
hasLanguage: target.hasLanguage !== undefined && required !== undefined
|
|
165
|
+
? [...new Set([...target.hasLanguage, ...required])]
|
|
166
|
+
: target.hasLanguage ?? required
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Tells whether two basic language ranges may be matched by a single tag.
|
|
171
|
+
*
|
|
172
|
+
* Either range may be the wildcard or a subtag prefix of the other, so `en` overlaps `en-US` but `de` misses `deu`.
|
|
173
|
+
*/
|
|
174
|
+
function overlaps(x, y) {
|
|
175
|
+
const [a, b] = [x.toLowerCase(), y.toLowerCase()];
|
|
176
|
+
return a === "*" || b === "*" || a === b || a.startsWith(`${b}-`) || b.startsWith(`${a}-`);
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=assembler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembler.js","sourceRoot":"","sources":["../../src/dictionary/assembler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAc,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI/C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,QAAQ,CAAgC,WAAkC;IAIzF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