@aidc-toolkit/utility 1.0.48-beta → 1.0.48

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 (57) hide show
  1. package/dist/index.cjs +17 -0
  2. package/dist/index.d.cts +699 -0
  3. package/dist/index.d.ts +699 -26
  4. package/dist/index.js +1 -9
  5. package/package.json +3 -3
  6. package/src/version.ts +1 -1
  7. package/tsconfig-src.tsbuildinfo +1 -1
  8. package/dist/character-set.d.ts +0 -242
  9. package/dist/character-set.d.ts.map +0 -1
  10. package/dist/character-set.js +0 -542
  11. package/dist/character-set.js.map +0 -1
  12. package/dist/exclusion.d.ts +0 -26
  13. package/dist/exclusion.d.ts.map +0 -1
  14. package/dist/exclusion.js +0 -18
  15. package/dist/exclusion.js.map +0 -1
  16. package/dist/index.d.ts.map +0 -1
  17. package/dist/index.js.map +0 -1
  18. package/dist/iterable-utility.d.ts +0 -39
  19. package/dist/iterable-utility.d.ts.map +0 -1
  20. package/dist/iterable-utility.js +0 -35
  21. package/dist/iterable-utility.js.map +0 -1
  22. package/dist/locale/en/locale-resources.d.ts +0 -33
  23. package/dist/locale/en/locale-resources.d.ts.map +0 -1
  24. package/dist/locale/en/locale-resources.js +0 -32
  25. package/dist/locale/en/locale-resources.js.map +0 -1
  26. package/dist/locale/fr/locale-resources.d.ts +0 -33
  27. package/dist/locale/fr/locale-resources.d.ts.map +0 -1
  28. package/dist/locale/fr/locale-resources.js +0 -32
  29. package/dist/locale/fr/locale-resources.js.map +0 -1
  30. package/dist/locale/i18n.d.ts +0 -27
  31. package/dist/locale/i18n.d.ts.map +0 -1
  32. package/dist/locale/i18n.js +0 -34
  33. package/dist/locale/i18n.js.map +0 -1
  34. package/dist/record.d.ts +0 -37
  35. package/dist/record.d.ts.map +0 -1
  36. package/dist/record.js +0 -58
  37. package/dist/record.js.map +0 -1
  38. package/dist/reg-exp.d.ts +0 -40
  39. package/dist/reg-exp.d.ts.map +0 -1
  40. package/dist/reg-exp.js +0 -55
  41. package/dist/reg-exp.js.map +0 -1
  42. package/dist/sequence.d.ts +0 -45
  43. package/dist/sequence.d.ts.map +0 -1
  44. package/dist/sequence.js +0 -96
  45. package/dist/sequence.js.map +0 -1
  46. package/dist/string.d.ts +0 -25
  47. package/dist/string.d.ts.map +0 -1
  48. package/dist/string.js +0 -2
  49. package/dist/string.js.map +0 -1
  50. package/dist/transformer.d.ts +0 -191
  51. package/dist/transformer.d.ts.map +0 -1
  52. package/dist/transformer.js +0 -459
  53. package/dist/transformer.js.map +0 -1
  54. package/dist/version.d.ts +0 -5
  55. package/dist/version.d.ts.map +0 -1
  56. package/dist/version.js +0 -5
  57. package/dist/version.js.map +0 -1
@@ -1,35 +0,0 @@
1
- /**
2
- * Map an input iterable to an output iterable that applies a transformer callback to each value in the input.
3
- *
4
- * @template TInput
5
- * Input type.
6
- *
7
- * @template TOutput
8
- * Output type.
9
- *
10
- * @param values
11
- * Input values iterable.
12
- *
13
- * @param indexedCallback
14
- * Callback to transform input value to output value.
15
- *
16
- * @returns
17
- * Output values iterable.
18
- */
19
- export function mapIterable(values, indexedCallback) {
20
- return {
21
- /**
22
- * Iterable implementation.
23
- *
24
- * @yields
25
- * Next output value.
26
- */
27
- *[Symbol.iterator]() {
28
- let index = 0;
29
- for (const value of values) {
30
- yield indexedCallback(value, index++);
31
- }
32
- }
33
- };
34
- }
35
- //# sourceMappingURL=iterable-utility.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iterable-utility.js","sourceRoot":"","sources":["../src/iterable-utility.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,WAAW,CAAkB,MAAwB,EAAE,eAAiD;IACpH,OAAO;QACH;;;;;WAKG;QACH,CAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,KAAK,GAAG,CAAC,CAAC;YAEd,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBACzB,MAAM,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAC1C,CAAC;QACL,CAAC;KACJ,CAAC;AACN,CAAC"}
@@ -1,33 +0,0 @@
1
- declare const _default: {
2
- Transformer: {
3
- domainMustBeGreaterThanZero: string;
4
- tweakMustBeGreaterThanOrEqualToZero: string;
5
- valueMustBeGreaterThanOrEqualToZero: string;
6
- valueMustBeLessThan: string;
7
- minimumValueMustBeGreaterThanOrEqualToZero: string;
8
- maximumValueMustBeLessThan: string;
9
- };
10
- RegExpValidator: {
11
- stringDoesNotMatchPattern: string;
12
- };
13
- CharacterSetValidator: {
14
- firstZeroFirstCharacter: string;
15
- allNumericAllNumericCharacters: string;
16
- stringMustNotBeAllNumeric: string;
17
- lengthMustBeGreaterThanOrEqualTo: string;
18
- lengthMustBeLessThanOrEqualTo: string;
19
- lengthMustBeEqualTo: string;
20
- lengthOfComponentMustBeGreaterThanOrEqualTo: string;
21
- lengthOfComponentMustBeLessThanOrEqualTo: string;
22
- lengthOfComponentMustBeEqualTo: string;
23
- invalidCharacterAtPosition: string;
24
- invalidCharacterAtPositionOfComponent: string;
25
- exclusionNotSupported: string;
26
- endSequenceValueMustBeLessThanOrEqualTo: string;
27
- };
28
- RecordValidator: {
29
- typeNameKeyNotFound: string;
30
- };
31
- };
32
- export default _default;
33
- //# sourceMappingURL=locale-resources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-resources.d.ts","sourceRoot":"","sources":["../../../src/locale/en/locale-resources.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA8BE"}
@@ -1,32 +0,0 @@
1
- export default {
2
- Transformer: {
3
- domainMustBeGreaterThanZero: "Domain {{domain, number}} must be greater than 0",
4
- tweakMustBeGreaterThanOrEqualToZero: "Tweak {{tweak, number}} must be greater than or equal to 0",
5
- valueMustBeGreaterThanOrEqualToZero: "Value {{value, number}} must be greater than or equal to 0",
6
- valueMustBeLessThan: "Value {{value, number}} must be less than {{domain, number}}",
7
- minimumValueMustBeGreaterThanOrEqualToZero: "Minimum value {{minimumValue, number}} must be greater than or equal to 0",
8
- maximumValueMustBeLessThan: "Maximum value {{maximumValue, number}} must be less than {{domain, number}}"
9
- },
10
- RegExpValidator: {
11
- stringDoesNotMatchPattern: "String {{s}} does not match pattern"
12
- },
13
- CharacterSetValidator: {
14
- firstZeroFirstCharacter: "Character set must support zero as first character",
15
- allNumericAllNumericCharacters: "Character set must support all numeric characters in sequence",
16
- stringMustNotBeAllNumeric: "String must not be all numeric",
17
- lengthMustBeGreaterThanOrEqualTo: "Length {{length, number}} must be greater than or equal to {{minimumLength, number}}",
18
- lengthMustBeLessThanOrEqualTo: "Length {{length, number}} must be less than or equal to {{maximumLength, number}}",
19
- lengthMustBeEqualTo: "Length {{length, number}} must be equal to {{exactLength, number}}",
20
- lengthOfComponentMustBeGreaterThanOrEqualTo: "Length {{length, number}} of {{component}} must be greater than or equal to {{minimumLength, number}}",
21
- lengthOfComponentMustBeLessThanOrEqualTo: "Length {{length, number}} of {{component}} must be less than or equal to {{maximumLength, number}}",
22
- lengthOfComponentMustBeEqualTo: "Length {{length, number}} of {{component}} must be equal to {{exactLength, number}}",
23
- invalidCharacterAtPosition: "Invalid character '{{c}}' at position {{position, number}}",
24
- invalidCharacterAtPositionOfComponent: "Invalid character '{{c}}' at position {{position, number}} of {{component}}",
25
- exclusionNotSupported: "Exclusion value of {{exclusion, number}} is not supported",
26
- endSequenceValueMustBeLessThanOrEqualTo: "End sequence value (start sequence value + count - 1) must be less than {{domain, number}}"
27
- },
28
- RecordValidator: {
29
- typeNameKeyNotFound: "{{typeName}} \"{{key}}\" not found"
30
- }
31
- };
32
- //# sourceMappingURL=locale-resources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-resources.js","sourceRoot":"","sources":["../../../src/locale/en/locale-resources.ts"],"names":[],"mappings":"AAAA,eAAe;IACX,WAAW,EAAE;QACT,2BAA2B,EAAE,kDAAkD;QAC/E,mCAAmC,EAAE,4DAA4D;QACjG,mCAAmC,EAAE,4DAA4D;QACjG,mBAAmB,EAAE,8DAA8D;QACnF,0CAA0C,EAAE,2EAA2E;QACvH,0BAA0B,EAAE,6EAA6E;KAC5G;IACD,eAAe,EAAE;QACb,yBAAyB,EAAE,qCAAqC;KACnE;IACD,qBAAqB,EAAE;QACnB,uBAAuB,EAAE,oDAAoD;QAC7E,8BAA8B,EAAE,+DAA+D;QAC/F,yBAAyB,EAAE,gCAAgC;QAC3D,gCAAgC,EAAE,sFAAsF;QACxH,6BAA6B,EAAE,mFAAmF;QAClH,mBAAmB,EAAE,oEAAoE;QACzF,2CAA2C,EAAE,uGAAuG;QACpJ,wCAAwC,EAAE,oGAAoG;QAC9I,8BAA8B,EAAE,qFAAqF;QACrH,0BAA0B,EAAE,4DAA4D;QACxF,qCAAqC,EAAE,6EAA6E;QACpH,qBAAqB,EAAE,2DAA2D;QAClF,uCAAuC,EAAE,4FAA4F;KACxI;IACD,eAAe,EAAE;QACb,mBAAmB,EAAE,oCAAoC;KAC5D;CACJ,CAAC"}
@@ -1,33 +0,0 @@
1
- declare const _default: {
2
- Transformer: {
3
- domainMustBeGreaterThanZero: string;
4
- tweakMustBeGreaterThanOrEqualToZero: string;
5
- valueMustBeGreaterThanOrEqualToZero: string;
6
- valueMustBeLessThan: string;
7
- minimumValueMustBeGreaterThanOrEqualToZero: string;
8
- maximumValueMustBeLessThan: string;
9
- };
10
- RegExpValidator: {
11
- stringDoesNotMatchPattern: string;
12
- };
13
- CharacterSetValidator: {
14
- firstZeroFirstCharacter: string;
15
- allNumericAllNumericCharacters: string;
16
- stringMustNotBeAllNumeric: string;
17
- lengthMustBeGreaterThanOrEqualTo: string;
18
- lengthMustBeLessThanOrEqualTo: string;
19
- lengthMustBeEqualTo: string;
20
- lengthOfComponentMustBeGreaterThanOrEqualTo: string;
21
- lengthOfComponentMustBeLessThanOrEqualTo: string;
22
- lengthOfComponentMustBeEqualTo: string;
23
- invalidCharacterAtPosition: string;
24
- invalidCharacterAtPositionOfComponent: string;
25
- exclusionNotSupported: string;
26
- endSequenceValueMustBeLessThanOrEqualTo: string;
27
- };
28
- RecordValidator: {
29
- typeNameKeyNotFound: string;
30
- };
31
- };
32
- export default _default;
33
- //# sourceMappingURL=locale-resources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-resources.d.ts","sourceRoot":"","sources":["../../../src/locale/fr/locale-resources.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA8BE"}
@@ -1,32 +0,0 @@
1
- export default {
2
- Transformer: {
3
- domainMustBeGreaterThanZero: "Le domaine {{domain, number}} doit être supérieur à 0",
4
- tweakMustBeGreaterThanOrEqualToZero: "Le réglage {{tweak, number}} doit être supérieur ou égal à 0",
5
- valueMustBeGreaterThanOrEqualToZero: "La valeur {{value, number}} doit être supérieure ou égale à 0",
6
- valueMustBeLessThan: "La valeur {{value, number}} doit être inférieure à {{domain, number}}",
7
- minimumValueMustBeGreaterThanOrEqualToZero: "La valeur minimale {{minimumValue, number}} doit être supérieure ou égale à 0",
8
- maximumValueMustBeLessThan: "La valeur maximale {{maximumValue, number}} doit être inférieure à {{domain, number}}"
9
- },
10
- RegExpValidator: {
11
- stringDoesNotMatchPattern: "La chaîne {{s}} ne correspond pas au modèle"
12
- },
13
- CharacterSetValidator: {
14
- firstZeroFirstCharacter: "Le jeu de caractères doit prendre en charge zéro comme premier caractère",
15
- allNumericAllNumericCharacters: "Le jeu de caractères doit prendre en charge tous les caractères numériques en séquence",
16
- stringMustNotBeAllNumeric: "La chaîne ne doit pas être entièrement numérique",
17
- lengthMustBeGreaterThanOrEqualTo: "La longueur {{length, number}} doit être supérieure ou égale à {{minimumLength, number}}",
18
- lengthMustBeLessThanOrEqualTo: "La longueur {{length, number}} doit être inférieure ou égale à {{maximumLength, number}}",
19
- lengthMustBeEqualTo: "La longueur {{length, number}} doit être égale à {{exactLength, number}}",
20
- lengthOfComponentMustBeGreaterThanOrEqualTo: "La longueur {{length, number}} de {{component}} doit être supérieure ou égale à {{minimumLength, number}}",
21
- lengthOfComponentMustBeLessThanOrEqualTo: "La longueur {{length, number}} de {{component}} doit être inférieure ou égale à {{maximumLength, number}}",
22
- lengthOfComponentMustBeEqualTo: "La longueur {{length, number}} de {{component}} doit être égale à {{exactLength, number}}",
23
- invalidCharacterAtPosition: "Caractère non valide '{{c}}' à la position {{position, number}}",
24
- invalidCharacterAtPositionOfComponent: "Caractère non valide '{{c}}' à la position {{position, number}} de {{component}}",
25
- exclusionNotSupported: "La valeur d'exclusion de {{exclusion, number}} n'est pas prise en charge",
26
- endSequenceValueMustBeLessThanOrEqualTo: "La valeur de la séquence de fin (valeur de la séquence de début + nombre - 1) doit être inférieure à {{domain, number}}"
27
- },
28
- RecordValidator: {
29
- typeNameKeyNotFound: "{{typeName}} « {{key}} » introuvable"
30
- }
31
- };
32
- //# sourceMappingURL=locale-resources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-resources.js","sourceRoot":"","sources":["../../../src/locale/fr/locale-resources.ts"],"names":[],"mappings":"AAAA,eAAe;IACX,WAAW,EAAE;QACT,2BAA2B,EAAE,uDAAuD;QACpF,mCAAmC,EAAE,8DAA8D;QACnG,mCAAmC,EAAE,+DAA+D;QACpG,mBAAmB,EAAE,uEAAuE;QAC5F,0CAA0C,EAAE,+EAA+E;QAC3H,0BAA0B,EAAE,uFAAuF;KACtH;IACD,eAAe,EAAE;QACb,yBAAyB,EAAE,6CAA6C;KAC3E;IACD,qBAAqB,EAAE;QACnB,uBAAuB,EAAE,0EAA0E;QACnG,8BAA8B,EAAE,wFAAwF;QACxH,yBAAyB,EAAE,kDAAkD;QAC7E,gCAAgC,EAAE,0FAA0F;QAC5H,6BAA6B,EAAE,0FAA0F;QACzH,mBAAmB,EAAE,0EAA0E;QAC/F,2CAA2C,EAAE,2GAA2G;QACxJ,wCAAwC,EAAE,2GAA2G;QACrJ,8BAA8B,EAAE,2FAA2F;QAC3H,0BAA0B,EAAE,iEAAiE;QAC7F,qCAAqC,EAAE,kFAAkF;QACzH,qBAAqB,EAAE,0EAA0E;QACjG,uCAAuC,EAAE,yHAAyH;KACrK;IACD,eAAe,EAAE;QACb,mBAAmB,EAAE,sCAAsC;KAC9D;CACJ,CAAC"}
@@ -1,27 +0,0 @@
1
- import { type I18nLanguageDetector } from "@aidc-toolkit/core";
2
- import { type i18n, type Resource } from "i18next";
3
- import enLocaleResources from "./en/locale-resources.js";
4
- export declare const utilityNS = "aidct_utility";
5
- /**
6
- * Locale strings type is extracted from the English locale strings object.
7
- */
8
- export type UtilityLocaleResources = typeof enLocaleResources;
9
- /**
10
- * Utility resource bundle.
11
- */
12
- export declare const utilityResourceBundle: Resource;
13
- export declare const i18nextUtility: i18n;
14
- /**
15
- * Initialize internationalization.
16
- *
17
- * @param languageDetector
18
- * Language detector.
19
- *
20
- * @param debug
21
- * Debug setting.
22
- *
23
- * @returns
24
- * Utility resource bundle.
25
- */
26
- export declare function i18nUtilityInit(languageDetector: I18nLanguageDetector, debug?: boolean): Promise<Resource>;
27
- //# sourceMappingURL=i18n.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/locale/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAgB,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AAGzD,eAAO,MAAM,SAAS,kBAAkB,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,iBAAiB,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAOnC,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,IAA+B,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,gBAAgB,EAAE,oBAAoB,EAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAE9G"}
@@ -1,34 +0,0 @@
1
- import { i18nCoreInit, i18nInit } from "@aidc-toolkit/core";
2
- import i18next from "i18next";
3
- import enLocaleResources from "./en/locale-resources.js";
4
- import frLocaleResources from "./fr/locale-resources.js";
5
- export const utilityNS = "aidct_utility";
6
- /**
7
- * Utility resource bundle.
8
- */
9
- export const utilityResourceBundle = {
10
- en: {
11
- aidct_utility: enLocaleResources
12
- },
13
- fr: {
14
- aidct_utility: frLocaleResources
15
- }
16
- };
17
- // Explicit type is necessary because type can't be inferred without additional references.
18
- export const i18nextUtility = i18next.createInstance();
19
- /**
20
- * Initialize internationalization.
21
- *
22
- * @param languageDetector
23
- * Language detector.
24
- *
25
- * @param debug
26
- * Debug setting.
27
- *
28
- * @returns
29
- * Utility resource bundle.
30
- */
31
- export async function i18nUtilityInit(languageDetector, debug = false) {
32
- return i18nInit(i18nextUtility, languageDetector, debug, utilityNS, utilityResourceBundle, i18nCoreInit);
33
- }
34
- //# sourceMappingURL=i18n.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/locale/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAA6B,MAAM,oBAAoB,CAAC;AACvF,OAAO,OAAqC,MAAM,SAAS,CAAC;AAC5D,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;AAOzC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAa;IAC3C,EAAE,EAAE;QACA,aAAa,EAAE,iBAAiB;KACnC;IACD,EAAE,EAAE;QACA,aAAa,EAAE,iBAAiB;KACnC;CACJ,CAAC;AAEF,2FAA2F;AAC3F,MAAM,CAAC,MAAM,cAAc,GAAS,OAAO,CAAC,cAAc,EAAE,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,gBAAsC,EAAE,KAAK,GAAG,KAAK;IACvF,OAAO,QAAQ,CAAC,cAAc,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,YAAY,CAAC,CAAC;AAC7G,CAAC"}
package/dist/record.d.ts DELETED
@@ -1,37 +0,0 @@
1
- import type { StringValidator } from "./string.js";
2
- /**
3
- * Record validator. Validation is performed against a record with a string key type and throws an error if the key is
4
- * not found.
5
- *
6
- * @template T
7
- * Property type.
8
- */
9
- export declare class RecordValidator<T> implements StringValidator {
10
- #private;
11
- /**
12
- * Constructor.
13
- *
14
- * @param typeName
15
- * Type name for error message.
16
- *
17
- * @param record
18
- * Record in which to look up keys.
19
- */
20
- constructor(typeName: string, record: Readonly<Record<string, T>>);
21
- /**
22
- * Get the type name.
23
- */
24
- get typeName(): string;
25
- /**
26
- * Get the record.
27
- */
28
- get record(): Readonly<Record<string, T>>;
29
- /**
30
- * Validate a key by looking it up in the record.
31
- *
32
- * @param key
33
- * Record key.
34
- */
35
- validate(key: string): void;
36
- }
37
- //# sourceMappingURL=record.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;GAMG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,eAAe;;IAWtD;;;;;;;;OAQG;gBACS,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAKjE;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAExC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAQ9B"}
package/dist/record.js DELETED
@@ -1,58 +0,0 @@
1
- import { i18nextUtility } from "./locale/i18n.js";
2
- /**
3
- * Record validator. Validation is performed against a record with a string key type and throws an error if the key is
4
- * not found.
5
- *
6
- * @template T
7
- * Property type.
8
- */
9
- export class RecordValidator {
10
- /**
11
- * Type name for error message.
12
- */
13
- #typeName;
14
- /**
15
- * Record in which to look up keys.
16
- */
17
- #record;
18
- /**
19
- * Constructor.
20
- *
21
- * @param typeName
22
- * Type name for error message.
23
- *
24
- * @param record
25
- * Record in which to look up keys.
26
- */
27
- constructor(typeName, record) {
28
- this.#typeName = typeName;
29
- this.#record = record;
30
- }
31
- /**
32
- * Get the type name.
33
- */
34
- get typeName() {
35
- return this.#typeName;
36
- }
37
- /**
38
- * Get the record.
39
- */
40
- get record() {
41
- return this.#record;
42
- }
43
- /**
44
- * Validate a key by looking it up in the record.
45
- *
46
- * @param key
47
- * Record key.
48
- */
49
- validate(key) {
50
- if (!(key in this.record)) {
51
- throw new RangeError(i18nextUtility.t("RecordValidator.typeNameKeyNotFound", {
52
- typeName: this.typeName,
53
- key
54
- }));
55
- }
56
- }
57
- }
58
- //# sourceMappingURL=record.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record.js","sourceRoot":"","sources":["../src/record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;;GAMG;AACH,MAAM,OAAO,eAAe;IACxB;;OAEG;IACM,SAAS,CAAS;IAE3B;;OAEG;IACM,OAAO,CAA8B;IAE9C;;;;;;;;OAQG;IACH,YAAY,QAAgB,EAAE,MAAmC;QAC7D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,GAAW;QAChB,IAAI,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,qCAAqC,EAAE;gBACzE,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,GAAG;aACN,CAAC,CAAC,CAAC;QACR,CAAC;IACL,CAAC;CACJ"}
package/dist/reg-exp.d.ts DELETED
@@ -1,40 +0,0 @@
1
- import type { StringValidator } from "./string.js";
2
- /**
3
- * Regular expression validator. The regular expression applies to the full string only if constructed as such. For
4
- * example, <code>&#x2F;\d&#x2A;&#x2F;</code> (0 or more digits) matches every string, <code>&#x2F;\d+&#x2F;</code> (1
5
- * or more digits) matches strings with at least one digit, <code>&#x2F;^\d&#x2A;$&#x2F;</code> matches strings that are
6
- * all digits or empty, and <code>&#x2F;^\d+$&#x2F;</code> matches strings that are all digits and not empty.
7
- *
8
- * Clients of this class are recommended to override the {@linkcode createErrorMessage | createErrorMessage()} method
9
- * to create a more suitable error message for their use case.
10
- */
11
- export declare class RegExpValidator implements StringValidator {
12
- #private;
13
- /**
14
- * Constructor.
15
- *
16
- * @param regExp
17
- * Regular expression. See {@link RegExpValidator | class documentation} for notes.
18
- */
19
- constructor(regExp: RegExp);
20
- /**
21
- * Get the regular expression.
22
- */
23
- get regExp(): RegExp;
24
- /**
25
- * Create an error message for a string. The generic error message is sufficient for many use cases but a more
26
- * domain-specific error message, possibly including the pattern itself, is often required.
27
- *
28
- * @param s
29
- * String.
30
- *
31
- * @returns
32
- * Error message.
33
- */
34
- protected createErrorMessage(s: string): string;
35
- /**
36
- * @inheritDoc
37
- */
38
- validate(s: string): void;
39
- }
40
- //# sourceMappingURL=reg-exp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reg-exp.d.ts","sourceRoot":"","sources":["../src/reg-exp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;GAQG;AACH,qBAAa,eAAgB,YAAW,eAAe;;IAMnD;;;;;OAKG;gBACS,MAAM,EAAE,MAAM;IAI1B;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;;;;;;OASG;IACH,SAAS,CAAC,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM/C;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;CAK5B"}
package/dist/reg-exp.js DELETED
@@ -1,55 +0,0 @@
1
- import { i18nextUtility } from "./locale/i18n.js";
2
- /**
3
- * Regular expression validator. The regular expression applies to the full string only if constructed as such. For
4
- * example, <code>&#x2F;\d&#x2A;&#x2F;</code> (0 or more digits) matches every string, <code>&#x2F;\d+&#x2F;</code> (1
5
- * or more digits) matches strings with at least one digit, <code>&#x2F;^\d&#x2A;$&#x2F;</code> matches strings that are
6
- * all digits or empty, and <code>&#x2F;^\d+$&#x2F;</code> matches strings that are all digits and not empty.
7
- *
8
- * Clients of this class are recommended to override the {@linkcode createErrorMessage | createErrorMessage()} method
9
- * to create a more suitable error message for their use case.
10
- */
11
- export class RegExpValidator {
12
- /**
13
- * Regular expression.
14
- */
15
- #regExp;
16
- /**
17
- * Constructor.
18
- *
19
- * @param regExp
20
- * Regular expression. See {@link RegExpValidator | class documentation} for notes.
21
- */
22
- constructor(regExp) {
23
- this.#regExp = regExp;
24
- }
25
- /**
26
- * Get the regular expression.
27
- */
28
- get regExp() {
29
- return this.#regExp;
30
- }
31
- /**
32
- * Create an error message for a string. The generic error message is sufficient for many use cases but a more
33
- * domain-specific error message, possibly including the pattern itself, is often required.
34
- *
35
- * @param s
36
- * String.
37
- *
38
- * @returns
39
- * Error message.
40
- */
41
- createErrorMessage(s) {
42
- return i18nextUtility.t("RegExpValidator.stringDoesNotMatchPattern", {
43
- s
44
- });
45
- }
46
- /**
47
- * @inheritDoc
48
- */
49
- validate(s) {
50
- if (!this.#regExp.test(s)) {
51
- throw new RangeError(this.createErrorMessage(s));
52
- }
53
- }
54
- }
55
- //# sourceMappingURL=reg-exp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reg-exp.js","sourceRoot":"","sources":["../src/reg-exp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAe;IACxB;;OAEG;IACM,OAAO,CAAS;IAEzB;;;;;OAKG;IACH,YAAY,MAAc;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;;;;;;;;OASG;IACO,kBAAkB,CAAC,CAAS;QAClC,OAAO,cAAc,CAAC,CAAC,CAAC,2CAA2C,EAAE;YACjE,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,CAAS;QACd,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC;IACL,CAAC;CACJ"}
@@ -1,45 +0,0 @@
1
- /**
2
- * Sequence. Defines an ascending or descending sequence of big integers implemented as an iterable.
3
- */
4
- export declare class Sequence implements Iterable<bigint> {
5
- #private;
6
- /**
7
- * Constructor.
8
- *
9
- * @param startValue
10
- * Start value.
11
- *
12
- * @param count
13
- * Count of values. If count is zero or positive, iteration ascends from start value, otherwise it descends from
14
- * start value.
15
- */
16
- constructor(startValue: number | bigint, count: number);
17
- /**
18
- * Get the start value (inclusive).
19
- */
20
- get startValue(): bigint;
21
- /**
22
- * Get the end value (exclusive).
23
- */
24
- get endValue(): bigint;
25
- /**
26
- * Get the count of values.
27
- */
28
- get count(): number;
29
- /**
30
- * Get the minimum value (inclusive).
31
- */
32
- get minimumValue(): bigint;
33
- /**
34
- * Get the maximum value (inclusive).
35
- */
36
- get maximumValue(): bigint;
37
- /**
38
- * Iterable implementation.
39
- *
40
- * @yields
41
- * Next value in sequence.
42
- */
43
- [Symbol.iterator](): Generator<bigint>;
44
- }
45
- //# sourceMappingURL=sequence.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../src/sequence.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,QAAS,YAAW,QAAQ,CAAC,MAAM,CAAC;;IA+B7C;;;;;;;;;OASG;gBACS,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM;IAgBtD;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;;;;OAKG;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC;CAK3C"}
package/dist/sequence.js DELETED
@@ -1,96 +0,0 @@
1
- /**
2
- * Sequence. Defines an ascending or descending sequence of big integers implemented as an iterable.
3
- */
4
- export class Sequence {
5
- /**
6
- * Start value (inclusive).
7
- */
8
- #startValue;
9
- /**
10
- * End value (exclusive).
11
- */
12
- #endValue;
13
- /**
14
- * Count of values.
15
- */
16
- #count;
17
- /**
18
- * Delta to the next value; equal to the sign of the count.
19
- */
20
- #nextDelta;
21
- /**
22
- * Minimum value (inclusive).
23
- */
24
- #minimumValue;
25
- /**
26
- * Maximum value (inclusive).
27
- */
28
- #maximumValue;
29
- /**
30
- * Constructor.
31
- *
32
- * @param startValue
33
- * Start value.
34
- *
35
- * @param count
36
- * Count of values. If count is zero or positive, iteration ascends from start value, otherwise it descends from
37
- * start value.
38
- */
39
- constructor(startValue, count) {
40
- this.#startValue = BigInt(startValue);
41
- this.#endValue = this.#startValue + BigInt(count);
42
- this.#count = count;
43
- if (count >= 0) {
44
- this.#nextDelta = 1n;
45
- this.#minimumValue = this.#startValue;
46
- this.#maximumValue = this.#endValue - 1n;
47
- }
48
- else {
49
- this.#nextDelta = -1n;
50
- this.#minimumValue = this.#endValue + 1n;
51
- this.#maximumValue = this.#startValue;
52
- }
53
- }
54
- /**
55
- * Get the start value (inclusive).
56
- */
57
- get startValue() {
58
- return this.#startValue;
59
- }
60
- /**
61
- * Get the end value (exclusive).
62
- */
63
- get endValue() {
64
- return this.#endValue;
65
- }
66
- /**
67
- * Get the count of values.
68
- */
69
- get count() {
70
- return this.#count;
71
- }
72
- /**
73
- * Get the minimum value (inclusive).
74
- */
75
- get minimumValue() {
76
- return this.#minimumValue;
77
- }
78
- /**
79
- * Get the maximum value (inclusive).
80
- */
81
- get maximumValue() {
82
- return this.#maximumValue;
83
- }
84
- /**
85
- * Iterable implementation.
86
- *
87
- * @yields
88
- * Next value in sequence.
89
- */
90
- *[Symbol.iterator]() {
91
- for (let value = this.#startValue; value !== this.#endValue; value += this.#nextDelta) {
92
- yield value;
93
- }
94
- }
95
- }
96
- //# sourceMappingURL=sequence.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sequence.js","sourceRoot":"","sources":["../src/sequence.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,QAAQ;IACjB;;OAEG;IACM,WAAW,CAAS;IAE7B;;OAEG;IACM,SAAS,CAAS;IAE3B;;OAEG;IACM,MAAM,CAAS;IAExB;;OAEG;IACM,UAAU,CAAW;IAE9B;;OAEG;IACM,aAAa,CAAS;IAE/B;;OAEG;IACM,aAAa,CAAS;IAE/B;;;;;;;;;OASG;IACH,YAAY,UAA2B,EAAE,KAAa;QAClD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;YACb,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC;YACtC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QAC7C,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;YACzC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC;QAC1C,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,CAAE,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,IAAI,CAAC,SAAS,EAAE,KAAK,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpF,MAAM,KAAK,CAAC;QAChB,CAAC;IACL,CAAC;CACJ"}
package/dist/string.d.ts DELETED
@@ -1,25 +0,0 @@
1
- /**
2
- * String validation interface. To ensure signature compatibility in implementing classes, string validation is
3
- * controlled by validation interfaces specific to each validator type.
4
- */
5
- export interface StringValidation {
6
- }
7
- /**
8
- * String validator interface.
9
- *
10
- * @template TStringValidation
11
- * String validation type.
12
- */
13
- export interface StringValidator<TStringValidation extends StringValidation = StringValidation> {
14
- /**
15
- * Validate a string and throw an error if validation fails.
16
- *
17
- * @param s
18
- * String.
19
- *
20
- * @param validation
21
- * String validation parameters.
22
- */
23
- validate: (s: string, validation?: TStringValidation) => void;
24
- }
25
- //# sourceMappingURL=string.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;CAChC;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,iBAAiB,SAAS,gBAAgB,GAAG,gBAAgB;IAC1F;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACjE"}
package/dist/string.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=string.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.js","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":""}