asn1-ts 9.0.3 → 10.0.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.
Files changed (100) hide show
  1. package/README.md +2 -0
  2. package/dist/classes/ABSTRACT-SYNTAX.d.mts +1 -1
  3. package/dist/classes/TYPE-IDENTIFIER.d.mts +1 -1
  4. package/dist/classes/index.d.mts +2 -2
  5. package/dist/codecs/ber/decoders/decodeBitString.d.mts +1 -1
  6. package/dist/codecs/ber/decoders/decodeBoolean.d.mts +1 -1
  7. package/dist/codecs/ber/decoders/decodeDuration.d.mts +1 -1
  8. package/dist/codecs/ber/decoders/decodeDuration.mjs +2 -2
  9. package/dist/codecs/ber/decoders/decodeGeneralizedTime.d.mts +1 -1
  10. package/dist/codecs/ber/decoders/decodeGeneralizedTime.mjs +10 -4
  11. package/dist/codecs/ber/decoders/decodeReal.d.mts +1 -1
  12. package/dist/codecs/ber/decoders/decodeSequence.d.mts +1 -1
  13. package/dist/codecs/ber/decoders/decodeUTCTime.d.mts +1 -1
  14. package/dist/codecs/ber/encoders/encodeGeneralString.d.mts +1 -1
  15. package/dist/codecs/ber/encoders/encodeGraphicString.d.mts +1 -1
  16. package/dist/codecs/ber/encoders/encodeNumericString.d.mts +1 -1
  17. package/dist/codecs/ber/encoders/encodeObjectDescriptor.d.mts +1 -1
  18. package/dist/codecs/ber/encoders/encodePrintableString.d.mts +1 -1
  19. package/dist/codecs/ber/encoders/encodeVisibleString.d.mts +1 -1
  20. package/dist/codecs/ber.d.mts +1 -1
  21. package/dist/codecs/ber.mjs +2 -1
  22. package/dist/codecs/cer/decoders/decodeSequence.d.mts +1 -1
  23. package/dist/codecs/cer.d.mts +1 -1
  24. package/dist/codecs/cer.mjs +2 -1
  25. package/dist/codecs/coer/decoders/decodeBoolean.d.mts +1 -1
  26. package/dist/codecs/der/decoders/decodeBitString.d.mts +1 -1
  27. package/dist/codecs/der/decoders/decodeBoolean.d.mts +1 -1
  28. package/dist/codecs/der/decoders/decodeDuration.d.mts +1 -1
  29. package/dist/codecs/der/decoders/decodeDuration.mjs +2 -2
  30. package/dist/codecs/der/decoders/decodeGeneralizedTime.d.mts +1 -1
  31. package/dist/codecs/der/decoders/decodeReal.d.mts +1 -1
  32. package/dist/codecs/der/decoders/decodeSequence.d.mts +1 -1
  33. package/dist/codecs/der/decoders/decodeUTCTime.d.mts +1 -1
  34. package/dist/codecs/der.d.mts +1 -1
  35. package/dist/codecs/der.mjs +1 -0
  36. package/dist/codecs/x690/decoders/decodeDate.d.mts +1 -1
  37. package/dist/codecs/x690/decoders/decodeDateTime.d.mts +1 -1
  38. package/dist/codecs/x690/decoders/decodeEmbeddedPDV.d.mts +1 -1
  39. package/dist/codecs/x690/decoders/decodeExternal.d.mts +1 -1
  40. package/dist/codecs/x690/decoders/decodeExternal.mjs +1 -0
  41. package/dist/codecs/x690/decoders/decodeGeneralString.d.mts +1 -1
  42. package/dist/codecs/x690/decoders/decodeGraphicString.d.mts +1 -1
  43. package/dist/codecs/x690/decoders/decodeInteger.d.mts +1 -1
  44. package/dist/codecs/x690/decoders/decodeNumericString.d.mts +1 -1
  45. package/dist/codecs/x690/decoders/decodeOIDIRI.d.mts +1 -1
  46. package/dist/codecs/x690/decoders/decodeObjectDescriptor.d.mts +1 -1
  47. package/dist/codecs/x690/decoders/decodeObjectIdentifier.d.mts +1 -1
  48. package/dist/codecs/x690/decoders/decodePrintableString.d.mts +1 -1
  49. package/dist/codecs/x690/decoders/decodeRelativeOIDIRI.d.mts +1 -1
  50. package/dist/codecs/x690/decoders/decodeRelativeObjectIdentifier.d.mts +1 -1
  51. package/dist/codecs/x690/decoders/decodeTime.d.mts +1 -1
  52. package/dist/codecs/x690/decoders/decodeTimeOfDay.d.mts +1 -1
  53. package/dist/codecs/x690/decoders/decodeVisibleString.d.mts +1 -1
  54. package/dist/codecs/x690/encoders/encodeBitString.d.mts +1 -1
  55. package/dist/codecs/x690/encoders/encodeBoolean.d.mts +1 -1
  56. package/dist/codecs/x690/encoders/encodeCharacterString.mjs +1 -0
  57. package/dist/codecs/x690/encoders/encodeDate.d.mts +1 -1
  58. package/dist/codecs/x690/encoders/encodeDateTime.d.mts +1 -1
  59. package/dist/codecs/x690/encoders/encodeDuration.d.mts +1 -1
  60. package/dist/codecs/x690/encoders/encodeEmbeddedPDV.d.mts +1 -1
  61. package/dist/codecs/x690/encoders/encodeExternal.d.mts +1 -1
  62. package/dist/codecs/x690/encoders/encodeGeneralizedTime.d.mts +1 -1
  63. package/dist/codecs/x690/encoders/encodeInteger.d.mts +1 -1
  64. package/dist/codecs/x690/encoders/encodeOIDIRI.d.mts +1 -1
  65. package/dist/codecs/x690/encoders/encodeObjectIdentifier.d.mts +1 -1
  66. package/dist/codecs/x690/encoders/encodeReal.d.mts +1 -1
  67. package/dist/codecs/x690/encoders/encodeRelativeOIDIRI.d.mts +1 -1
  68. package/dist/codecs/x690/encoders/encodeRelativeObjectIdentifier.d.mts +1 -1
  69. package/dist/codecs/x690/encoders/encodeSequence.d.mts +1 -1
  70. package/dist/codecs/x690/encoders/encodeSequence.mjs +1 -0
  71. package/dist/codecs/x690/encoders/encodeTime.d.mts +1 -1
  72. package/dist/codecs/x690/encoders/encodeTimeOfDay.d.mts +1 -1
  73. package/dist/codecs/x690/encoders/encodeUTCTime.d.mts +1 -1
  74. package/dist/functional.d.mts +40 -42
  75. package/dist/functional.mjs +118 -118
  76. package/dist/index.d.mts +0 -2
  77. package/dist/index.mjs +0 -1
  78. package/dist/interfaces/index.d.mts +12 -12
  79. package/dist/types/External.d.mts +1 -1
  80. package/dist/types/TypeIdentifier.mjs +1 -0
  81. package/dist/types/time/DATE-ENCODING.d.mts +1 -1
  82. package/dist/types/time/DURATION-EQUIVALENT.d.mts +1 -1
  83. package/dist/types/time/DURATION-INTERVAL-ENCODING.d.mts +1 -1
  84. package/dist/types/time/HOURS-DIFF-ENCODING.d.mts +1 -1
  85. package/dist/types/time/HOURS-ENCODING.d.mts +1 -1
  86. package/dist/types/time/HOURS-MINUTES-DIFF-ENCODING.d.mts +1 -1
  87. package/dist/types/time/HOURS-MINUTES-ENCODING.d.mts +1 -1
  88. package/dist/types/time/TIME-OF-DAY-DIFF-ENCODING.d.mts +1 -1
  89. package/dist/types/time/TIME-OF-DAY-ENCODING.d.mts +1 -1
  90. package/dist/types/time/TIME-OF-DAY-FRACTION-DIFF-ENCODING.d.mts +1 -1
  91. package/dist/types/time/TIME-OF-DAY-FRACTION-ENCODING.d.mts +1 -1
  92. package/dist/types/time/YEAR-ENCODING.d.mts +1 -1
  93. package/dist/types/time/YEAR-MONTH-ENCODING.d.mts +1 -1
  94. package/dist/utils/isInCanonicalOrder.mjs +1 -1
  95. package/dist/utils/packBits.d.mts +1 -1
  96. package/dist/utils/unpackBits.d.mts +1 -1
  97. package/dist/validators/datetimeComponentValidator.d.mts +1 -1
  98. package/dist/values.d.mts +1 -0
  99. package/dist/values.mjs +2 -1
  100. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- export { default as Byteable } from "./Byteable.mjs";
2
- export { default as CharacterValidationFunction } from "./CharacterValidationFunction.mjs";
3
- export { default as Debyteable } from "./Debyteable.mjs";
4
- export { default as Deelementable } from "./Deelementable.mjs";
5
- export { default as Destringable } from "./Destringable.mjs";
6
- export { default as Elementable } from "./Elementable.mjs";
7
- export { default as Enbyteable } from "./Enbyteable.mjs";
8
- export { default as Enelementable } from "./Enelementable.mjs";
9
- export { default as Enstringable } from "./Enstringable.mjs";
10
- export { default as Identified } from "./Identified.mjs";
11
- export { default as Named } from "./Named.mjs";
12
- export { default as Stringable } from "./Stringable.mjs";
1
+ export type { default as Byteable } from "./Byteable.mjs";
2
+ export type { default as CharacterValidationFunction } from "./CharacterValidationFunction.mjs";
3
+ export type { default as Debyteable } from "./Debyteable.mjs";
4
+ export type { default as Deelementable } from "./Deelementable.mjs";
5
+ export type { default as Destringable } from "./Destringable.mjs";
6
+ export type { default as Elementable } from "./Elementable.mjs";
7
+ export type { default as Enbyteable } from "./Enbyteable.mjs";
8
+ export type { default as Enelementable } from "./Enelementable.mjs";
9
+ export type { default as Enstringable } from "./Enstringable.mjs";
10
+ export type { default as Identified } from "./Identified.mjs";
11
+ export type { default as Named } from "./Named.mjs";
12
+ export type { default as Stringable } from "./Stringable.mjs";
@@ -1,4 +1,4 @@
1
- import { BIT_STRING, INTEGER, OBJECT_IDENTIFIER, OCTET_STRING, ObjectDescriptor } from "../macros.mjs";
1
+ import type { BIT_STRING, INTEGER, OBJECT_IDENTIFIER, OCTET_STRING, ObjectDescriptor } from "../macros.mjs";
2
2
  import type ASN1Element from "../asn1.mjs";
3
3
  export default class External {
4
4
  readonly directReference: OBJECT_IDENTIFIER | undefined;
@@ -1,3 +1,4 @@
1
+ import ObjectIdentifier from "./ObjectIdentifier.mjs";
1
2
  export default class TypeIdentifier {
2
3
  constructor(id, type) {
3
4
  this.id = id;
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class DATE_ENCODING {
3
3
  readonly year: INTEGER;
4
4
  readonly month: INTEGER;
@@ -1,4 +1,4 @@
1
- import { INTEGER, OPTIONAL } from "../../macros.mjs";
1
+ import type { INTEGER, OPTIONAL } from "../../macros.mjs";
2
2
  export default class DURATION_EQUIVALENT {
3
3
  readonly years: OPTIONAL<INTEGER>;
4
4
  readonly months: OPTIONAL<INTEGER>;
@@ -1,4 +1,4 @@
1
- import { INTEGER, OPTIONAL } from "../../macros.mjs";
1
+ import type { INTEGER, OPTIONAL } from "../../macros.mjs";
2
2
  export default class DURATION_INTERVAL_ENCODING {
3
3
  readonly years: OPTIONAL<INTEGER>;
4
4
  readonly months: OPTIONAL<INTEGER>;
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class HOURS_DIFF_ENCODING {
3
3
  readonly hours: INTEGER;
4
4
  readonly minutes_diff: INTEGER;
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class HOURS_ENCODING {
3
3
  readonly hours: INTEGER;
4
4
  constructor(hours: INTEGER);
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class HOURS_MINUTES_DIFF_ENCODING {
3
3
  readonly hours: INTEGER;
4
4
  readonly minutes: INTEGER;
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class HOURS_MINUTES_ENCODING {
3
3
  readonly hours: INTEGER;
4
4
  readonly minutes: INTEGER;
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class TIME_OF_DAY_DIFF_ENCODING {
3
3
  readonly hours: INTEGER;
4
4
  readonly minutes: INTEGER;
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class TIME_OF_DAY_ENCODING {
3
3
  readonly hours: INTEGER;
4
4
  readonly minutes: INTEGER;
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class TIME_OF_DAY_FRACTION_DIFF_ENCODING {
3
3
  readonly hours: INTEGER;
4
4
  readonly minutes: INTEGER;
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class TIME_OF_DAY_FRACTION_ENCODING {
3
3
  readonly hours: INTEGER;
4
4
  readonly minutes: INTEGER;
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class YEAR_ENCODING {
3
3
  readonly year: INTEGER;
4
4
  constructor(year: INTEGER);
@@ -1,4 +1,4 @@
1
- import { INTEGER } from "../../macros.mjs";
1
+ import type { INTEGER } from "../../macros.mjs";
2
2
  export default class YEAR_MONTH_ENCODING {
3
3
  readonly year: INTEGER;
4
4
  readonly month: INTEGER;
@@ -1,4 +1,4 @@
1
- import { CANONICAL_TAG_CLASS_ORDERING } from "../values.mjs";
1
+ import { ASN1TagClass, CANONICAL_TAG_CLASS_ORDERING } from "../values.mjs";
2
2
  export default function isInCanonicalOrder(elements) {
3
3
  let previousTagClass = null;
4
4
  let previousTagNumber = null;
@@ -1,2 +1,2 @@
1
- import { BIT_STRING } from "../macros.mjs";
1
+ import type { BIT_STRING } from "../macros.mjs";
2
2
  export default function packBits(bits: BIT_STRING): Uint8Array;
@@ -1,2 +1,2 @@
1
- import { BIT_STRING } from "../macros.mjs";
1
+ import type { BIT_STRING } from "../macros.mjs";
2
2
  export default function unpackBits(bytes: Uint8Array): BIT_STRING;
@@ -1,2 +1,2 @@
1
- import { INTEGER } from "../macros.mjs";
1
+ import type { INTEGER } from "../macros.mjs";
2
2
  export default function datetimeComponentValidator(unitName: string, min: INTEGER, max: INTEGER): (dataType: string, value: INTEGER) => void;
package/dist/values.d.mts CHANGED
@@ -85,4 +85,5 @@ export declare const canonicalNR3Regex: RegExp;
85
85
  export declare const distinguishedNR3Regex: RegExp;
86
86
  export declare const CANONICAL_TAG_CLASS_ORDERING: ASN1TagClass[];
87
87
  export declare const numberRegex: string;
88
+ export declare const durationRegex: RegExp;
88
89
  export declare const datetimeRegex: RegExp;
package/dist/values.mjs CHANGED
@@ -97,7 +97,7 @@ export const CANONICAL_TAG_CLASS_ORDERING = [
97
97
  ASN1TagClass.private,
98
98
  ];
99
99
  export const numberRegex = "(?:0|[1-9]\\d*)(?:\\.\\d+)?";
100
- export const datetimeRegex = new RegExp("^(?:(" + numberRegex + ")Y)?"
100
+ export const durationRegex = new RegExp("^(?:(" + numberRegex + ")Y)?"
101
101
  + "(?:(" + numberRegex + ")M)?"
102
102
  + "(?:(" + numberRegex + ")D)?"
103
103
  + "(?:T"
@@ -105,3 +105,4 @@ export const datetimeRegex = new RegExp("^(?:(" + numberRegex + ")Y)?"
105
105
  + "(?:(" + numberRegex + ")M)?"
106
106
  + "(?:(" + numberRegex + ")S)?"
107
107
  + ")?$");
108
+ export const datetimeRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/;
package/package.json CHANGED
@@ -48,5 +48,5 @@
48
48
  "test": "node --test"
49
49
  },
50
50
  "types": "./dist/index.d.mts",
51
- "version": "9.0.3"
51
+ "version": "10.0.0"
52
52
  }