@ac-kit/format-asn1 0.4.1 → 0.5.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.md +131 -0
- package/README.md +68 -0
- package/dist/_encoding/def-tags.d.ts +3 -6
- package/dist/_encoding/def-tags.d.ts.map +1 -1
- package/dist/_encoding/def-tags.js.map +1 -1
- package/dist/_encoding/default-wire-value.d.ts.map +1 -1
- package/dist/_encoding/default-wire-value.js.map +1 -1
- package/dist/_encoding/restricted-string.d.ts +22 -0
- package/dist/_encoding/restricted-string.d.ts.map +1 -0
- package/dist/_encoding/restricted-string.js +76 -0
- package/dist/_encoding/restricted-string.js.map +1 -0
- package/dist/_encoding/tag.d.ts +2 -2
- package/dist/_encoding/tag.d.ts.map +1 -1
- package/dist/_encoding/tlv.d.ts +2 -2
- package/dist/_encoding/tlv.d.ts.map +1 -1
- package/dist/_encoding/tlv.js.map +1 -1
- package/dist/_encoding/unknown-extensions.d.ts +14 -0
- package/dist/_encoding/unknown-extensions.d.ts.map +1 -0
- package/dist/_encoding/unknown-extensions.js +56 -0
- package/dist/_encoding/unknown-extensions.js.map +1 -0
- package/dist/_encoding/values.d.ts +14 -9
- package/dist/_encoding/values.d.ts.map +1 -1
- package/dist/_encoding/values.js +12 -2
- package/dist/_encoding/values.js.map +1 -1
- package/dist/ber/_decode.d.ts.map +1 -1
- package/dist/ber/_decode.js +30 -17
- package/dist/ber/_decode.js.map +1 -1
- package/dist/ber/encode.d.ts +5 -1
- package/dist/ber/encode.d.ts.map +1 -1
- package/dist/ber/encode.js +33 -14
- package/dist/ber/encode.js.map +1 -1
- package/dist/cer/encode.d.ts +5 -1
- package/dist/cer/encode.d.ts.map +1 -1
- package/dist/cer/encode.js +46 -13
- package/dist/cer/encode.js.map +1 -1
- package/dist/der/decode.d.ts.map +1 -1
- package/dist/der/decode.js +23 -9
- package/dist/der/decode.js.map +1 -1
- package/dist/der/encode.d.ts +5 -1
- package/dist/der/encode.d.ts.map +1 -1
- package/dist/der/encode.js +53 -17
- package/dist/der/encode.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/per/decode.d.ts.map +1 -1
- package/dist/per/decode.js.map +1 -1
- package/dist/per/encode.d.ts.map +1 -1
- package/dist/per/encode.js +7 -1
- package/dist/per/encode.js.map +1 -1
- package/dist/reader/ber-reader.d.ts +4 -1
- package/dist/reader/ber-reader.d.ts.map +1 -1
- package/dist/reader/ber-reader.js +50 -10
- package/dist/reader/ber-reader.js.map +1 -1
- package/dist/schema/constraints/pattern.d.ts +38 -2
- package/dist/schema/constraints/pattern.d.ts.map +1 -1
- package/dist/schema/constraints/pattern.js +10 -2
- package/dist/schema/constraints/pattern.js.map +1 -1
- package/dist/schema/module.d.ts.map +1 -1
- package/dist/schema/module.js.map +1 -1
- package/dist/schema/pattern/_names.d.ts +16 -0
- package/dist/schema/pattern/_names.d.ts.map +1 -0
- package/dist/schema/pattern/_names.js +237 -0
- package/dist/schema/pattern/_names.js.map +1 -0
- package/dist/schema/pattern/_parse.d.ts +17 -0
- package/dist/schema/pattern/_parse.d.ts.map +1 -0
- package/dist/schema/pattern/_parse.js +427 -0
- package/dist/schema/pattern/_parse.js.map +1 -0
- package/dist/schema/pattern/asn1-pattern-syntax-error.d.ts +13 -0
- package/dist/schema/pattern/asn1-pattern-syntax-error.d.ts.map +1 -0
- package/dist/schema/pattern/asn1-pattern-syntax-error.js +16 -0
- package/dist/schema/pattern/asn1-pattern-syntax-error.js.map +1 -0
- package/dist/schema/pattern/asn1-pattern.d.ts +95 -0
- package/dist/schema/pattern/asn1-pattern.d.ts.map +1 -0
- package/dist/schema/pattern/asn1-pattern.js +81 -0
- package/dist/schema/pattern/asn1-pattern.js.map +1 -0
- package/dist/schema/types/any-def.d.ts +31 -1
- package/dist/schema/types/any-def.d.ts.map +1 -1
- package/dist/schema/types/base.d.ts +4 -4
- package/dist/schema/types/base.d.ts.map +1 -1
- package/dist/schema/types/base.js.map +1 -1
- package/dist/schema/types/constructed/choice.d.ts +2 -2
- package/dist/schema/types/constructed/choice.d.ts.map +1 -1
- package/dist/schema/types/constructed/component.d.ts +2 -2
- package/dist/schema/types/constructed/component.d.ts.map +1 -1
- package/dist/schema/types/constructed/component.js.map +1 -1
- package/dist/schema/types/constructed/sequence-of.d.ts +2 -2
- package/dist/schema/types/constructed/sequence-of.d.ts.map +1 -1
- package/dist/schema/types/constructed/sequence-of.js.map +1 -1
- package/dist/schema/types/constructed/sequence.d.ts +2 -2
- package/dist/schema/types/constructed/sequence.d.ts.map +1 -1
- package/dist/schema/types/constructed/set-of.d.ts +2 -2
- package/dist/schema/types/constructed/set-of.d.ts.map +1 -1
- package/dist/schema/types/constructed/set-of.js.map +1 -1
- package/dist/schema/types/constructed/set.d.ts +2 -2
- package/dist/schema/types/constructed/set.d.ts.map +1 -1
- package/dist/schema/types/information-object/information-object.d.ts +2 -2
- package/dist/schema/types/information-object/information-object.d.ts.map +1 -1
- package/dist/schema/types/information-object/information-object.js.map +1 -1
- package/dist/schema/types/information-object/open-type.d.ts +4 -3
- package/dist/schema/types/information-object/open-type.d.ts.map +1 -1
- package/dist/schema/types/information-object/open-type.js +1 -3
- package/dist/schema/types/information-object/open-type.js.map +1 -1
- package/dist/schema/types/primitives/lazy.d.ts +2 -2
- package/dist/schema/types/primitives/lazy.d.ts.map +1 -1
- package/dist/schema/types/primitives/lazy.js.map +1 -1
- package/dist/schema/types/strings/string-base.d.ts +6 -2
- package/dist/schema/types/strings/string-base.d.ts.map +1 -1
- package/dist/schema/types/strings/string-base.js +3 -1
- package/dist/schema/types/strings/string-base.js.map +1 -1
- package/dist/schema/unknown-extensions.d.ts +57 -0
- package/dist/schema/unknown-extensions.d.ts.map +1 -0
- package/dist/schema/unknown-extensions.js +32 -0
- package/dist/schema/unknown-extensions.js.map +1 -0
- package/dist/schema/validate.d.ts +19 -4
- package/dist/schema/validate.d.ts.map +1 -1
- package/dist/schema/validate.js +299 -7
- package/dist/schema/validate.js.map +1 -1
- package/package.json +12 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-base.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/strings/string-base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,6EAA6E;AAC7E,MAAM,MAAM,cAAc,GACvB,YAAY,GACZ,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,gBAAgB,GAChB,WAAW,GACX,eAAe,GACf,eAAe,GACf,eAAe,GACf,iBAAiB,GACjB,WAAW,CAAC;AAEf,4DAA4D;AAC5D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IACtE,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACnD,CAAC;AAEH;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC/B,6BAA6B;IAC7B,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,CAAC,CAAC;IACpE,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC;IAC3B
|
|
1
|
+
{"version":3,"file":"string-base.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/strings/string-base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE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xVal });
|
|
18
18
|
},
|
|
19
19
|
alphabet: (chars) => append({ kind: "permittedAlphabet", alphabet: chars }),
|
|
20
|
-
pattern: (pat) => append(
|
|
20
|
+
pattern: (pat, names) => append(names === undefined
|
|
21
|
+
? { kind: "pattern", pattern: pat }
|
|
22
|
+
: { kind: "pattern", pattern: pat, names }),
|
|
21
23
|
constrainedBy: (description) => append({ kind: "userDefinedConstraint", description }),
|
|
22
24
|
};
|
|
23
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-base.js","sourceRoot":"","sources":["../../../../src/schema/types/strings/string-base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"string-base.js","sourceRoot":"","sources":["../../../../src/schema/types/strings/string-base.ts"],"names":[],"mappings":"AA2CA;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAKjC,GAAM,EAAE,MAAwB;IACjC,MAAM,MAAM,GAAG,CAAC,CAAmB,EAAK,EAAE,CACzC,MAAM,CAAC,EAAE,GAAG,GAAG,EAAE,WAAW,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,OAAO;QACN,IAAI,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE;YACzB,MAAM,MAAM,GACX,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;YAClE,MAAM,MAAM,GACX,GAAG,KAAK,SAAS;gBAChB,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,GAAG,KAAK,KAAK;oBACd,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ;wBACxB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;wBACb,CAAC,CAAC,GAAG,CAAC;YACV,OAAO,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAC3E,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CACvB,MAAM,CACL,KAAK,KAAK,SAAS;YAClB,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE;YACnC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAC3C;QACF,aAAa,EAAE,CAAC,WAAW,EAAE,EAAE,CAC9B,MAAM,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,WAAW,EAAE,CAAC;KACvD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The key under which a decoded SEQUENCE or SET value keeps the extension
|
|
3
|
+
* additions its schema does not know, and under which an encoder finds them
|
|
4
|
+
* again (X.680 §6, §7.1): a value decoded with an older schema relays a newer
|
|
5
|
+
* sender's additions unchanged.
|
|
6
|
+
*
|
|
7
|
+
* The key is a symbol, so `Object.keys`, `JSON.stringify` and `WITH COMPONENTS`
|
|
8
|
+
* checks do not see it; it is only set when there is something to keep. The
|
|
9
|
+
* value types do not declare it: read it with
|
|
10
|
+
* {@link unknownExtensionAdditionsOf}. An encoder given the decoded value back
|
|
11
|
+
* writes the additions again.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const v1 = sequence([component("a", integer()), extensionMarker]);
|
|
16
|
+
* const value = derDecode(v1, bytesFromV2);
|
|
17
|
+
* unknownExtensionAdditionsOf(value)?.encodings.length; // 1
|
|
18
|
+
* derEncode(v1, value); // bytesFromV2, the unknown addition included
|
|
19
|
+
* ```;
|
|
20
|
+
*/
|
|
21
|
+
export declare const unknownExtensionAdditions: unique symbol;
|
|
22
|
+
/** The X.690 rules a {@link Asn1UnknownExtensionAdditions} was read under. */
|
|
23
|
+
export type Asn1UnknownExtensionRules = "ber" | "cer" | "der";
|
|
24
|
+
/**
|
|
25
|
+
* Extension additions a decoder met but could not decode, its schema not
|
|
26
|
+
* knowing them: the delimited encodings X.680 §7.1 c) requires.
|
|
27
|
+
*
|
|
28
|
+
* X.680 §6 lets a later encoding include them only under the transfer syntax
|
|
29
|
+
* they came in: `berEncode` takes additions read under any X.690 rules (DER and
|
|
30
|
+
* CER encodings are BER encodings), `cerEncode` only those read by `cerDecode`,
|
|
31
|
+
* `derEncode` only those read by a strict `derDecode`.
|
|
32
|
+
*/
|
|
33
|
+
export interface Asn1UnknownExtensionAdditions {
|
|
34
|
+
/**
|
|
35
|
+
* The rules the additions were read under: `"der"` for a strict `derDecode`,
|
|
36
|
+
* `"ber"` for a lenient one.
|
|
37
|
+
*/
|
|
38
|
+
readonly rules: Asn1UnknownExtensionRules;
|
|
39
|
+
/**
|
|
40
|
+
* Each addition's whole encoding (identifier, length and contents octets), in
|
|
41
|
+
* the order received. An encoder writes them where they were met: before the
|
|
42
|
+
* root components that follow a second extension marker, else after the last
|
|
43
|
+
* component; DER and CER sort a SET's by tag with the known components.
|
|
44
|
+
*/
|
|
45
|
+
readonly encodings: readonly Uint8Array[];
|
|
46
|
+
}
|
|
47
|
+
/** The member a SEQUENCE or SET value may carry its unknown additions in. */
|
|
48
|
+
export interface Asn1UnknownExtensionAdditionsCarrier {
|
|
49
|
+
readonly [unknownExtensionAdditions]?: Asn1UnknownExtensionAdditions;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The extension additions a decoded SEQUENCE or SET value carries, its schema
|
|
53
|
+
* not knowing them: `undefined` when there are none, or for anything but an
|
|
54
|
+
* object. O(1).
|
|
55
|
+
*/
|
|
56
|
+
export declare function unknownExtensionAdditionsOf(value: unknown): Asn1UnknownExtensionAdditions | undefined;
|
|
57
|
+
//# sourceMappingURL=unknown-extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unknown-extensions.d.ts","sourceRoot":"","sources":["../../src/schema/unknown-extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,EAAE,OAAO,MAE9C,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,yBAAyB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,yBAAyB,CAAC;IAE1C;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS,UAAU,EAAE,CAAC;CAC1C;AAED,6EAA6E;AAC7E,MAAM,WAAW,oCAAoC;IACpD,QAAQ,CAAC,CAAC,yBAAyB,CAAC,CAAC,EAAE,6BAA6B,CAAC;CACrE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,OAAO,GACZ,6BAA6B,GAAG,SAAS,CAI3C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The key under which a decoded SEQUENCE or SET value keeps the extension
|
|
3
|
+
* additions its schema does not know, and under which an encoder finds them
|
|
4
|
+
* again (X.680 §6, §7.1): a value decoded with an older schema relays a newer
|
|
5
|
+
* sender's additions unchanged.
|
|
6
|
+
*
|
|
7
|
+
* The key is a symbol, so `Object.keys`, `JSON.stringify` and `WITH COMPONENTS`
|
|
8
|
+
* checks do not see it; it is only set when there is something to keep. The
|
|
9
|
+
* value types do not declare it: read it with
|
|
10
|
+
* {@link unknownExtensionAdditionsOf}. An encoder given the decoded value back
|
|
11
|
+
* writes the additions again.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const v1 = sequence([component("a", integer()), extensionMarker]);
|
|
16
|
+
* const value = derDecode(v1, bytesFromV2);
|
|
17
|
+
* unknownExtensionAdditionsOf(value)?.encodings.length; // 1
|
|
18
|
+
* derEncode(v1, value); // bytesFromV2, the unknown addition included
|
|
19
|
+
* ```;
|
|
20
|
+
*/
|
|
21
|
+
export const unknownExtensionAdditions = Symbol.for("@ac-kit/format-asn1.unknownExtensionAdditions");
|
|
22
|
+
/**
|
|
23
|
+
* The extension additions a decoded SEQUENCE or SET value carries, its schema
|
|
24
|
+
* not knowing them: `undefined` when there are none, or for anything but an
|
|
25
|
+
* object. O(1).
|
|
26
|
+
*/
|
|
27
|
+
export function unknownExtensionAdditionsOf(value) {
|
|
28
|
+
return typeof value === "object" && value !== null
|
|
29
|
+
? value[unknownExtensionAdditions]
|
|
30
|
+
: undefined;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=unknown-extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unknown-extensions.js","sourceRoot":"","sources":["../../src/schema/unknown-extensions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAkB,MAAM,CAAC,GAAG,CACjE,+CAA+C,CAC/C,CAAC;AAmCF;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAC1C,KAAc;IAEd,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QACjD,CAAC,CAAE,KAA8C,CAAC,yBAAyB,CAAC;QAC5E,CAAC,CAAC,SAAS,CAAC;AACd,CAAC"}
|
|
@@ -23,10 +23,10 @@ export interface ConstraintCheckResult {
|
|
|
23
23
|
/**
|
|
24
24
|
* Perform structural validation on a schema def tree.
|
|
25
25
|
*
|
|
26
|
-
* Checks: - Range / size constraints: min ≤ max. -
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* ancestor).
|
|
26
|
+
* Checks: - Range / size constraints: min ≤ max. - `PATTERN` constraints: their
|
|
27
|
+
* expression compiles. - Unique component names in SEQUENCE and SET. -
|
|
28
|
+
* `paramRef` / `paramValueRef` are only valid inside a parameterized type body
|
|
29
|
+
* (detected as top-level uses that have no template ancestor).
|
|
30
30
|
*
|
|
31
31
|
* Never throws — returns all violations as a list. Meant for schemas written in
|
|
32
32
|
* code: its walk is exponential in the number of mutually recursive `lazy`
|
|
@@ -38,6 +38,21 @@ export declare function validateSchema(def: AnyAsn1TypeDef): ValidationResult;
|
|
|
38
38
|
* Check a runtime value against the declared constraints of a def.
|
|
39
39
|
*
|
|
40
40
|
* Returns all violations; never throws. This is encoding-format independent.
|
|
41
|
+
*
|
|
42
|
+
* Set arithmetic is evaluated as such: a union is met when one operand is, an
|
|
43
|
+
* intersection when all are (`ALL` is the intersection of nothing), and `base
|
|
44
|
+
* EXCEPT excluded` when the base is and the excluded set is not. `WITH
|
|
45
|
+
* COMPONENT` checks every element of a SEQUENCE OF or SET OF value, and `WITH
|
|
46
|
+
* COMPONENTS` the presence and the constraint of each named component or
|
|
47
|
+
* alternative; a full specification (`partial: false`) admits no component it
|
|
48
|
+
* does not name (X.680 §51.8). `PATTERN` holds when the whole string value
|
|
49
|
+
* matches its X.680 Annex A regular expression (§51.9), compiled once per def
|
|
50
|
+
* by {@link compileAsn1Pattern} with the def's `names` and matched in linear
|
|
51
|
+
* time; a pattern that does not compile, or a run that outgrows the default
|
|
52
|
+
* `format-regex` limits, is reported as a violation rather than thrown. A
|
|
53
|
+
* constraint this check cannot evaluate (contents, table, component relation
|
|
54
|
+
* and user-defined constraints) is taken as met, so an operand of a union never
|
|
55
|
+
* fails because of it.
|
|
41
56
|
*/
|
|
42
57
|
export declare function checkValueConstraint(def: AnyAsn1TypeDef, value: unknown): ConstraintCheckResult;
|
|
43
58
|
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/schema/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/schema/validate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMpD,+DAA+D;AAC/D,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AAED,kCAAkC;AAClC,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAClD;AAID,qCAAqC;AACrC,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AAED,wCAAwC;AACxC,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACpD;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,gBAAgB,CAwDpE;AAqED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CACnC,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,OAAO,GACZ,qBAAqB,CAQvB"}
|
package/dist/schema/validate.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { RegexLimitExceededError, } from "@ac-kit/format-regex";
|
|
2
|
+
import { Asn1PatternSyntaxError } from "./pattern/asn1-pattern-syntax-error.js";
|
|
3
|
+
import { compileAsn1Pattern } from "./pattern/asn1-pattern.js";
|
|
1
4
|
import { walkDef } from "./walk.js";
|
|
2
5
|
// ── validateSchema ────────────────────────────────────────────────────────────
|
|
3
6
|
/**
|
|
4
7
|
* Perform structural validation on a schema def tree.
|
|
5
8
|
*
|
|
6
|
-
* Checks: - Range / size constraints: min ≤ max. -
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* ancestor).
|
|
9
|
+
* Checks: - Range / size constraints: min ≤ max. - `PATTERN` constraints: their
|
|
10
|
+
* expression compiles. - Unique component names in SEQUENCE and SET. -
|
|
11
|
+
* `paramRef` / `paramValueRef` are only valid inside a parameterized type body
|
|
12
|
+
* (detected as top-level uses that have no template ancestor).
|
|
10
13
|
*
|
|
11
14
|
* Never throws — returns all violations as a list. Meant for schemas written in
|
|
12
15
|
* code: its walk is exponential in the number of mutually recursive `lazy`
|
|
@@ -51,6 +54,7 @@ export function validateSchema(def) {
|
|
|
51
54
|
[];
|
|
52
55
|
for (const c of constraints) {
|
|
53
56
|
checkRangeBounds(c, path, errors);
|
|
57
|
+
checkPatternSyntax_(c, path, errors);
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
if (node.kind === "paramRef" || node.kind === "paramValueRef") {
|
|
@@ -87,21 +91,241 @@ function checkRangeBounds(c, path, errors) {
|
|
|
87
91
|
checkRangeBounds(c.constraint, path, errors);
|
|
88
92
|
}
|
|
89
93
|
}
|
|
94
|
+
/** Reports a `PATTERN` that does not compile, wherever set arithmetic puts it. */
|
|
95
|
+
function checkPatternSyntax_(c, path, errors) {
|
|
96
|
+
switch (c.kind) {
|
|
97
|
+
case "pattern": {
|
|
98
|
+
const compiled = compiledPattern_(c);
|
|
99
|
+
if (compiled instanceof Error) {
|
|
100
|
+
errors.push({
|
|
101
|
+
path,
|
|
102
|
+
message: `PATTERN "${c.pattern}": ${compiled.message}`,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
case "union":
|
|
108
|
+
case "intersection":
|
|
109
|
+
for (const operand of c.operands) {
|
|
110
|
+
checkPatternSyntax_(operand, path, errors);
|
|
111
|
+
}
|
|
112
|
+
return;
|
|
113
|
+
case "except":
|
|
114
|
+
checkPatternSyntax_(c.base, path, errors);
|
|
115
|
+
checkPatternSyntax_(c.excluded, path, errors);
|
|
116
|
+
return;
|
|
117
|
+
case "extensibleConstraint":
|
|
118
|
+
checkPatternSyntax_(c.constraint, path, errors);
|
|
119
|
+
return;
|
|
120
|
+
default:
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
90
124
|
// ── checkValueConstraint ──────────────────────────────────────────────────────
|
|
91
125
|
/**
|
|
92
126
|
* Check a runtime value against the declared constraints of a def.
|
|
93
127
|
*
|
|
94
128
|
* Returns all violations; never throws. This is encoding-format independent.
|
|
129
|
+
*
|
|
130
|
+
* Set arithmetic is evaluated as such: a union is met when one operand is, an
|
|
131
|
+
* intersection when all are (`ALL` is the intersection of nothing), and `base
|
|
132
|
+
* EXCEPT excluded` when the base is and the excluded set is not. `WITH
|
|
133
|
+
* COMPONENT` checks every element of a SEQUENCE OF or SET OF value, and `WITH
|
|
134
|
+
* COMPONENTS` the presence and the constraint of each named component or
|
|
135
|
+
* alternative; a full specification (`partial: false`) admits no component it
|
|
136
|
+
* does not name (X.680 §51.8). `PATTERN` holds when the whole string value
|
|
137
|
+
* matches its X.680 Annex A regular expression (§51.9), compiled once per def
|
|
138
|
+
* by {@link compileAsn1Pattern} with the def's `names` and matched in linear
|
|
139
|
+
* time; a pattern that does not compile, or a run that outgrows the default
|
|
140
|
+
* `format-regex` limits, is reported as a violation rather than thrown. A
|
|
141
|
+
* constraint this check cannot evaluate (contents, table, component relation
|
|
142
|
+
* and user-defined constraints) is taken as met, so an operand of a union never
|
|
143
|
+
* fails because of it.
|
|
95
144
|
*/
|
|
96
145
|
export function checkValueConstraint(def, value) {
|
|
97
146
|
const violations = [];
|
|
98
147
|
const constraints = def.constraints ?? [];
|
|
99
148
|
for (const c of constraints) {
|
|
100
|
-
checkOneConstraint(c, value, violations);
|
|
149
|
+
checkOneConstraint(c, value, def, violations);
|
|
101
150
|
}
|
|
102
151
|
return { ok: violations.length === 0, violations };
|
|
103
152
|
}
|
|
104
|
-
|
|
153
|
+
/** The def under `lazy` and `tagged` wrappers. */
|
|
154
|
+
function structuralDef_(def) {
|
|
155
|
+
const visited = new Set();
|
|
156
|
+
let current = def;
|
|
157
|
+
while (current !== undefined &&
|
|
158
|
+
(current.kind === "lazy" || current.kind === "tagged") &&
|
|
159
|
+
!visited.has(current)) {
|
|
160
|
+
visited.add(current);
|
|
161
|
+
current = current.kind === "lazy" ? current.getter() : current.innerType;
|
|
162
|
+
}
|
|
163
|
+
return current;
|
|
164
|
+
}
|
|
165
|
+
/** The def of a named component or alternative of a SEQUENCE, SET or CHOICE def. */
|
|
166
|
+
function memberDef_(def, name) {
|
|
167
|
+
const members = def?.kind === "sequence" || def?.kind === "set"
|
|
168
|
+
? def.components
|
|
169
|
+
: def?.kind === "choice"
|
|
170
|
+
? def.alternatives
|
|
171
|
+
: [];
|
|
172
|
+
for (const member of members) {
|
|
173
|
+
if ("kind" in member && member.kind === "extensionAdditionGroup") {
|
|
174
|
+
const components = member.components;
|
|
175
|
+
const found = components.find((component) => component.name === name);
|
|
176
|
+
if (found !== undefined) {
|
|
177
|
+
return found.type;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else if ("name" in member && member.name === name) {
|
|
181
|
+
return member.type;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
function checkSetArithmetic_(c, value, def, violations) {
|
|
187
|
+
if (c.kind === "union") {
|
|
188
|
+
const met = c.operands.some((operand) => {
|
|
189
|
+
const operandViolations = [];
|
|
190
|
+
checkOneConstraint(operand, value, def, operandViolations);
|
|
191
|
+
return operandViolations.length === 0;
|
|
192
|
+
});
|
|
193
|
+
if (!met) {
|
|
194
|
+
violations.push({
|
|
195
|
+
constraint: c,
|
|
196
|
+
message: `Value is in none of the ${c.operands.length} sets of the union`,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
if (c.kind === "intersection") {
|
|
202
|
+
for (const operand of c.operands) {
|
|
203
|
+
checkOneConstraint(operand, value, def, violations);
|
|
204
|
+
}
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
if (c.kind === "except") {
|
|
208
|
+
checkOneConstraint(c.base, value, def, violations);
|
|
209
|
+
const excludedViolations = [];
|
|
210
|
+
checkOneConstraint(c.excluded, value, def, excludedViolations);
|
|
211
|
+
if (excludedViolations.length === 0 && admitsDecidably_(c.excluded)) {
|
|
212
|
+
violations.push({ constraint: c, message: "Value is in the EXCEPT set" });
|
|
213
|
+
}
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Whether a check of `c` that finds no violation proves the value is in it,
|
|
220
|
+
* which an EXCEPT needs before it rejects a value: not for a constraint taken
|
|
221
|
+
* as met because it cannot be evaluated.
|
|
222
|
+
*/
|
|
223
|
+
function admitsDecidably_(c) {
|
|
224
|
+
switch (c.kind) {
|
|
225
|
+
case "contentsConstraint":
|
|
226
|
+
case "tableConstraint":
|
|
227
|
+
case "componentRelationConstraint":
|
|
228
|
+
case "userDefinedConstraint":
|
|
229
|
+
return false;
|
|
230
|
+
case "union":
|
|
231
|
+
return c.operands.every(admitsDecidably_);
|
|
232
|
+
case "intersection":
|
|
233
|
+
return c.operands.every(admitsDecidably_);
|
|
234
|
+
case "except":
|
|
235
|
+
return admitsDecidably_(c.base) && admitsDecidably_(c.excluded);
|
|
236
|
+
case "extensibleConstraint":
|
|
237
|
+
case "withComponent":
|
|
238
|
+
return admitsDecidably_(c.constraint);
|
|
239
|
+
case "withComponents":
|
|
240
|
+
return Object.values(c.components).every((entry) => entry.constraint === undefined || admitsDecidably_(entry.constraint));
|
|
241
|
+
default:
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function checkInnerSubtyping_(c, value, def, violations) {
|
|
246
|
+
if (c.kind === "withComponent") {
|
|
247
|
+
if (Array.isArray(value)) {
|
|
248
|
+
const structural = structuralDef_(def);
|
|
249
|
+
const elementDef = structural?.kind === "sequenceOf" || structural?.kind === "setOf"
|
|
250
|
+
? structural.elementType
|
|
251
|
+
: undefined;
|
|
252
|
+
for (const [index, element] of value.entries()) {
|
|
253
|
+
const elementViolations = [];
|
|
254
|
+
checkOneConstraint(c.constraint, element, elementDef, elementViolations);
|
|
255
|
+
for (const violation of elementViolations) {
|
|
256
|
+
violations.push({
|
|
257
|
+
constraint: violation.constraint,
|
|
258
|
+
message: `Element ${index}: ${violation.message}`,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return true;
|
|
264
|
+
}
|
|
265
|
+
if (c.kind !== "withComponents") {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
if (typeof value !== "object" || value === null) {
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
const structural = structuralDef_(def);
|
|
272
|
+
const isChoice = structural?.kind === "choice";
|
|
273
|
+
const record = value;
|
|
274
|
+
const presentValue = (name) => isChoice
|
|
275
|
+
? record["kind"] === name
|
|
276
|
+
? record["value"]
|
|
277
|
+
: undefined
|
|
278
|
+
: Object.hasOwn(record, name)
|
|
279
|
+
? record[name]
|
|
280
|
+
: undefined;
|
|
281
|
+
for (const [name, entry] of Object.entries(c.components)) {
|
|
282
|
+
const member = presentValue(name);
|
|
283
|
+
const present = member !== undefined;
|
|
284
|
+
if (entry.presence === "present" && !present) {
|
|
285
|
+
violations.push({
|
|
286
|
+
constraint: c,
|
|
287
|
+
message: `Component "${name}" must be present`,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
if (entry.presence === "absent" && present) {
|
|
291
|
+
violations.push({
|
|
292
|
+
constraint: c,
|
|
293
|
+
message: `Component "${name}" must be absent`,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
if (entry.constraint !== undefined && present) {
|
|
297
|
+
const memberViolations = [];
|
|
298
|
+
checkOneConstraint(entry.constraint, member, memberDef_(structural, name), memberViolations);
|
|
299
|
+
for (const violation of memberViolations) {
|
|
300
|
+
violations.push({
|
|
301
|
+
constraint: violation.constraint,
|
|
302
|
+
message: `Component "${name}": ${violation.message}`,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (!c.partial) {
|
|
308
|
+
const presentNames = isChoice
|
|
309
|
+
? typeof record["kind"] === "string"
|
|
310
|
+
? [record["kind"]]
|
|
311
|
+
: []
|
|
312
|
+
: Object.keys(record).filter((name) => record[name] !== undefined);
|
|
313
|
+
for (const name of presentNames) {
|
|
314
|
+
if (!Object.hasOwn(c.components, name)) {
|
|
315
|
+
violations.push({
|
|
316
|
+
constraint: c,
|
|
317
|
+
message: `Component "${name}" is not in the full WITH COMPONENTS list`,
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return true;
|
|
323
|
+
}
|
|
324
|
+
function checkOneConstraint(c, value, def, violations) {
|
|
325
|
+
if (checkSetArithmetic_(c, value, def, violations) ||
|
|
326
|
+
checkInnerSubtyping_(c, value, def, violations)) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
105
329
|
if (c.kind === "valueRange") {
|
|
106
330
|
const n = typeof value === "bigint"
|
|
107
331
|
? value
|
|
@@ -172,8 +396,76 @@ function checkOneConstraint(c, value, violations) {
|
|
|
172
396
|
}
|
|
173
397
|
if (c.kind === "extensibleConstraint") {
|
|
174
398
|
// Extension root is checked; extension additions are not.
|
|
175
|
-
checkOneConstraint(c.constraint, value, violations);
|
|
399
|
+
checkOneConstraint(c.constraint, value, def, violations);
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
if (c.kind === "pattern") {
|
|
403
|
+
if (typeof value === "string") {
|
|
404
|
+
checkPattern_(c, value, violations);
|
|
405
|
+
}
|
|
176
406
|
return;
|
|
177
407
|
}
|
|
178
408
|
}
|
|
409
|
+
/** Each pattern compiled once, or the reason it cannot be. */
|
|
410
|
+
const COMPILED_PATTERNS_ = new WeakMap();
|
|
411
|
+
/**
|
|
412
|
+
* The compiled matcher of a `PATTERN` def, `\N{name}` resolved through its
|
|
413
|
+
* `names` (own keys only), or the error that prevents compiling it.
|
|
414
|
+
*/
|
|
415
|
+
function compiledPattern_(c) {
|
|
416
|
+
const known = COMPILED_PATTERNS_.get(c);
|
|
417
|
+
if (known !== undefined) {
|
|
418
|
+
return known;
|
|
419
|
+
}
|
|
420
|
+
const { names } = c;
|
|
421
|
+
let compiled;
|
|
422
|
+
try {
|
|
423
|
+
compiled = compileAsn1Pattern(c.pattern, {
|
|
424
|
+
resolveName: (name) => names !== undefined && Object.hasOwn(names, name)
|
|
425
|
+
? names[name]
|
|
426
|
+
: undefined,
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
catch (error) {
|
|
430
|
+
if (error instanceof Asn1PatternSyntaxError ||
|
|
431
|
+
error instanceof RegexLimitExceededError) {
|
|
432
|
+
compiled = error;
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
throw error;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
COMPILED_PATTERNS_.set(c, compiled);
|
|
439
|
+
return compiled;
|
|
440
|
+
}
|
|
441
|
+
function checkPattern_(c, value, violations) {
|
|
442
|
+
const compiled = compiledPattern_(c);
|
|
443
|
+
if (compiled instanceof Error) {
|
|
444
|
+
violations.push({
|
|
445
|
+
constraint: c,
|
|
446
|
+
message: `PATTERN "${c.pattern}" cannot be checked: ${compiled.message}`,
|
|
447
|
+
});
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
let matched;
|
|
451
|
+
try {
|
|
452
|
+
matched = compiled.match(value);
|
|
453
|
+
}
|
|
454
|
+
catch (error) {
|
|
455
|
+
if (!(error instanceof RegexLimitExceededError)) {
|
|
456
|
+
throw error;
|
|
457
|
+
}
|
|
458
|
+
violations.push({
|
|
459
|
+
constraint: c,
|
|
460
|
+
message: `PATTERN "${c.pattern}" cannot be checked: ${error.message}`,
|
|
461
|
+
});
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
if (!matched) {
|
|
465
|
+
violations.push({
|
|
466
|
+
constraint: c,
|
|
467
|
+
message: `Value does not match PATTERN "${c.pattern}"`,
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
}
|
|
179
471
|
//# sourceMappingURL=validate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/schema/validate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8BpC,iFAAiF;AAEjF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,GAAmB;IACjD,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QAC3B,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YACrD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;YAChC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACpC,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;oBAC/B,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;wBAC1B,MAAM,CAAC,IAAI,CAAC;4BACX,IAAI;4BACJ,OAAO,EAAE,8BAA8B,IAAI,CAAC,IAAI,GAAG;yBACnD,CAAC,CAAC;oBACJ,CAAC;oBACD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CA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,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACrC,IAAI,QAAQ,YAAY,KAAK,EAAE,CAAC;QAC/B,UAAU,CAAC,IAAI,CAAC;YACf,UAAU,EAAE,CAAC;YACb,OAAO,EAAE,YAAY,CAAC,CAAC,OAAO,wBAAwB,QAAQ,CAAC,OAAO,EAAE;SACxE,CAAC,CAAC;QACH,OAAO;IACR,CAAC;IACD,IAAI,OAAgB,CAAC;IACrB,IAAI,CAAC;QACJ,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,CAAC,CAAC,KAAK,YAAY,uBAAuB,CAAC,EAAE,CAAC;YACjD,MAAM,KAAK,CAAC;QACb,CAAC;QACD,UAAU,CAAC,IAAI,CAAC;YACf,UAAU,EAAE,CAAC;YACb,OAAO,EAAE,YAAY,CAAC,CAAC,OAAO,wBAAwB,KAAK,CAAC,OAAO,EAAE;SACrE,CAAC,CAAC;QACH,OAAO;IACR,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,UAAU,CAAC,IAAI,CAAC;YACf,UAAU,EAAE,CAAC;YACb,OAAO,EAAE,iCAAiC,CAAC,CAAC,OAAO,GAAG;SACtD,CAAC,CAAC;IACJ,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/format-asn1",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "ASN.1 (X.690) runtime: encoding primitives, the schema model, and the BER, CER, DER and PER codecs as separate subpath exports.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"asn1",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"der",
|
|
10
10
|
"x690"
|
|
11
11
|
],
|
|
12
|
-
"homepage": "https://
|
|
12
|
+
"homepage": "https://anthochamp.pages.grenadine.io/node-essentials/api/format-asn1/",
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
|
|
15
15
|
},
|
|
@@ -53,20 +53,22 @@
|
|
|
53
53
|
"prepack": "yarn build"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@ac-kit/algo": "^0.
|
|
57
|
-
"@ac-kit/core": "^0.
|
|
58
|
-
"@ac-kit/format-core": "^0.5.
|
|
59
|
-
"@ac-kit/format-oid": "^0.
|
|
60
|
-
"@ac-kit/format-
|
|
61
|
-
"@ac-kit/
|
|
56
|
+
"@ac-kit/algo": "^0.7.0",
|
|
57
|
+
"@ac-kit/core": "^0.14.0",
|
|
58
|
+
"@ac-kit/format-core": "^0.5.1",
|
|
59
|
+
"@ac-kit/format-oid": "^0.3.0",
|
|
60
|
+
"@ac-kit/format-regex": "^0.4.0",
|
|
61
|
+
"@ac-kit/format-varint": "^0.3.0",
|
|
62
|
+
"@ac-kit/math-numbers": "^0.3.0",
|
|
62
63
|
"@types/node": "^26.5.1"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
66
|
"@ac-kit/fixture-x509": "0.1.0",
|
|
66
|
-
"@ac-kit/math-random": "0.4.
|
|
67
|
+
"@ac-kit/math-random": "0.4.2",
|
|
68
|
+
"@ac-kit/test-util": "0.5.1",
|
|
67
69
|
"@ac-kit/tsconfig": "0.1.0",
|
|
68
70
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
69
|
-
"@ac-kit/vitest-config": "0.
|
|
71
|
+
"@ac-kit/vitest-config": "0.3.0",
|
|
70
72
|
"@typescript/native": "typescript@7.0.2",
|
|
71
73
|
"rimraf": "6.1.4",
|
|
72
74
|
"typedoc": "0.28.20",
|