@aidc-toolkit/utility 1.0.23-beta → 1.0.25-beta
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/README.md +30 -30
- package/dist/index.cjs +3570 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +953 -0
- package/dist/index.d.ts +953 -26
- package/dist/index.js +3505 -8
- package/dist/index.js.map +1 -1
- package/package.json +7 -11
- package/src/character-set.ts +20 -19
- package/src/exclusion.ts +6 -1
- package/src/index.ts +9 -9
- package/src/locale/i18n.ts +3 -5
- package/src/locale/i18next.d.ts +1 -1
- package/src/record.ts +2 -2
- package/src/reg-exp.ts +7 -7
- package/src/string.ts +3 -3
- package/src/transformer.ts +19 -18
- package/test/record.test.ts +3 -1
- package/tsup.config.ts +3 -0
- package/typedoc.json +1 -3
- package/dist/character-set.d.ts +0 -307
- package/dist/character-set.d.ts.map +0 -1
- package/dist/character-set.js +0 -563
- package/dist/character-set.js.map +0 -1
- package/dist/exclusion.d.ts +0 -22
- package/dist/exclusion.d.ts.map +0 -1
- package/dist/exclusion.js +0 -18
- package/dist/exclusion.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/iterable-utility.d.ts +0 -39
- package/dist/iterable-utility.d.ts.map +0 -1
- package/dist/iterable-utility.js +0 -35
- package/dist/iterable-utility.js.map +0 -1
- package/dist/locale/en/locale-resources.d.ts +0 -33
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -32
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -33
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -32
- package/dist/locale/fr/locale-resources.js.map +0 -1
- package/dist/locale/i18n.d.ts +0 -27
- package/dist/locale/i18n.d.ts.map +0 -1
- package/dist/locale/i18n.js +0 -35
- package/dist/locale/i18n.js.map +0 -1
- package/dist/record.d.ts +0 -44
- package/dist/record.d.ts.map +0 -1
- package/dist/record.js +0 -58
- package/dist/record.js.map +0 -1
- package/dist/reg-exp.d.ts +0 -43
- package/dist/reg-exp.d.ts.map +0 -1
- package/dist/reg-exp.js +0 -55
- package/dist/reg-exp.js.map +0 -1
- package/dist/sequence.d.ts +0 -68
- package/dist/sequence.d.ts.map +0 -1
- package/dist/sequence.js +0 -96
- package/dist/sequence.js.map +0 -1
- package/dist/string.d.ts +0 -25
- package/dist/string.d.ts.map +0 -1
- package/dist/string.js +0 -2
- package/dist/string.js.map +0 -1
- package/dist/transformer.d.ts +0 -346
- package/dist/transformer.d.ts.map +0 -1
- package/dist/transformer.js +0 -456
- package/dist/transformer.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iterable-utility.d.ts","sourceRoot":"","sources":["../src/iterable-utility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,eAAe,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAE1F;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,EAAE,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAgB3I"}
|
package/dist/iterable-utility.js
DELETED
|
@@ -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
|
-
readonly Transformer: {
|
|
3
|
-
readonly domainMustBeGreaterThanZero: "Domain {{domain, number}} must be greater than 0";
|
|
4
|
-
readonly tweakMustBeGreaterThanOrEqualToZero: "Tweak {{tweak, number}} must be greater than or equal to 0";
|
|
5
|
-
readonly valueMustBeGreaterThanOrEqualToZero: "Value {{value, number}} must be greater than or equal to 0";
|
|
6
|
-
readonly valueMustBeLessThan: "Value {{value, number}} must be less than {{domain, number}}";
|
|
7
|
-
readonly minimumValueMustBeGreaterThanOrEqualToZero: "Minimum value {{minimumValue, number}} must be greater than or equal to 0";
|
|
8
|
-
readonly maximumValueMustBeLessThan: "Maximum value {{maximumValue, number}} must be less than {{domain, number}}";
|
|
9
|
-
};
|
|
10
|
-
readonly RegExpValidator: {
|
|
11
|
-
readonly stringDoesNotMatchPattern: "String {{s}} does not match pattern";
|
|
12
|
-
};
|
|
13
|
-
readonly CharacterSetValidator: {
|
|
14
|
-
readonly firstZeroFirstCharacter: "Character set must support zero as first character";
|
|
15
|
-
readonly allNumericAllNumericCharacters: "Character set must support all numeric characters in sequence";
|
|
16
|
-
readonly stringMustNotBeAllNumeric: "String must not be all numeric";
|
|
17
|
-
readonly lengthMustBeGreaterThanOrEqualTo: "Length {{length, number}} must be greater than or equal to {{minimumLength, number}}";
|
|
18
|
-
readonly lengthMustBeLessThanOrEqualTo: "Length {{length, number}} must be less than or equal to {{maximumLength, number}}";
|
|
19
|
-
readonly lengthMustBeEqualTo: "Length {{length, number}} must be equal to {{exactLength, number}}";
|
|
20
|
-
readonly lengthOfComponentMustBeGreaterThanOrEqualTo: "Length {{length, number}} of {{component}} must be greater than or equal to {{minimumLength, number}}";
|
|
21
|
-
readonly lengthOfComponentMustBeLessThanOrEqualTo: "Length {{length, number}} of {{component}} must be less than or equal to {{maximumLength, number}}";
|
|
22
|
-
readonly lengthOfComponentMustBeEqualTo: "Length {{length, number}} of {{component}} must be equal to {{exactLength, number}}";
|
|
23
|
-
readonly invalidCharacterAtPosition: "Invalid character '{{c}}' at position {{position, number}}";
|
|
24
|
-
readonly invalidCharacterAtPositionOfComponent: "Invalid character '{{c}}' at position {{position, number}} of {{component}}";
|
|
25
|
-
readonly exclusionNotSupported: "Exclusion value of {{exclusion, number}} is not supported";
|
|
26
|
-
readonly endSequenceValueMustBeLessThanOrEqualTo: "End sequence value (start sequence value + count - 1) must be less than {{domain, number}}";
|
|
27
|
-
};
|
|
28
|
-
readonly RecordValidator: {
|
|
29
|
-
readonly typeNameKeyNotFound: "{{typeName}} \"{{key}}\" not found";
|
|
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,wBA8BW"}
|
|
@@ -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;CACK,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
readonly Transformer: {
|
|
3
|
-
readonly domainMustBeGreaterThanZero: "Le domaine {{domain, number}} doit être supérieur à 0";
|
|
4
|
-
readonly tweakMustBeGreaterThanOrEqualToZero: "Le réglage {{tweak, number}} doit être supérieur ou égal à 0";
|
|
5
|
-
readonly valueMustBeGreaterThanOrEqualToZero: "La valeur {{value, number}} doit être supérieure ou égale à 0";
|
|
6
|
-
readonly valueMustBeLessThan: "La valeur {{value, number}} doit être inférieure à {{domain, number}}";
|
|
7
|
-
readonly minimumValueMustBeGreaterThanOrEqualToZero: "La valeur minimale {{minimumValue, number}} doit être supérieure ou égale à 0";
|
|
8
|
-
readonly maximumValueMustBeLessThan: "La valeur maximale {{maximumValue, number}} doit être inférieure à {{domain, number}}";
|
|
9
|
-
};
|
|
10
|
-
readonly RegExpValidator: {
|
|
11
|
-
readonly stringDoesNotMatchPattern: "La chaîne {{s}} ne correspond pas au modèle";
|
|
12
|
-
};
|
|
13
|
-
readonly CharacterSetValidator: {
|
|
14
|
-
readonly firstZeroFirstCharacter: "Le jeu de caractères doit prendre en charge zéro comme premier caractère";
|
|
15
|
-
readonly allNumericAllNumericCharacters: "Le jeu de caractères doit prendre en charge tous les caractères numériques en séquence";
|
|
16
|
-
readonly stringMustNotBeAllNumeric: "La chaîne ne doit pas être entièrement numérique";
|
|
17
|
-
readonly lengthMustBeGreaterThanOrEqualTo: "La longueur {{length, number}} doit être supérieure ou égale à {{minimumLength, number}}";
|
|
18
|
-
readonly lengthMustBeLessThanOrEqualTo: "La longueur {{length, number}} doit être inférieure ou égale à {{maximumLength, number}}";
|
|
19
|
-
readonly lengthMustBeEqualTo: "La longueur {{length, number}} doit être égale à {{exactLength, number}}";
|
|
20
|
-
readonly lengthOfComponentMustBeGreaterThanOrEqualTo: "La longueur {{length, number}} de {{component}} doit être supérieure ou égale à {{minimumLength, number}}";
|
|
21
|
-
readonly lengthOfComponentMustBeLessThanOrEqualTo: "La longueur {{length, number}} de {{component}} doit être inférieure ou égale à {{maximumLength, number}}";
|
|
22
|
-
readonly lengthOfComponentMustBeEqualTo: "La longueur {{length, number}} de {{component}} doit être égale à {{exactLength, number}}";
|
|
23
|
-
readonly invalidCharacterAtPosition: "Caractère non valide '{{c}}' à la position {{position, number}}";
|
|
24
|
-
readonly invalidCharacterAtPositionOfComponent: "Caractère non valide '{{c}}' à la position {{position, number}} de {{component}}";
|
|
25
|
-
readonly exclusionNotSupported: "La valeur d'exclusion de {{exclusion, number}} n'est pas prise en charge";
|
|
26
|
-
readonly 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
|
-
readonly RecordValidator: {
|
|
29
|
-
readonly typeNameKeyNotFound: "{{typeName}} \"{{key}}\" introuvable";
|
|
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,wBA8BW"}
|
|
@@ -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;CACK,CAAC"}
|
package/dist/locale/i18n.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { type I18nEnvironment } 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 resources.
|
|
11
|
-
*/
|
|
12
|
-
export declare const utilityResources: Resource;
|
|
13
|
-
export declare const i18nextUtility: i18n;
|
|
14
|
-
/**
|
|
15
|
-
* Initialize internationalization.
|
|
16
|
-
*
|
|
17
|
-
* @param environment
|
|
18
|
-
* Environment in which the application is running.
|
|
19
|
-
*
|
|
20
|
-
* @param debug
|
|
21
|
-
* Debug setting.
|
|
22
|
-
*
|
|
23
|
-
* @returns
|
|
24
|
-
* Void promise.
|
|
25
|
-
*/
|
|
26
|
-
export declare function i18nUtilityInit(environment: I18nEnvironment, debug?: boolean): Promise<void>;
|
|
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,EAA0C,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClG,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;AAI9D;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAO9B,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,IAA+B,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhG"}
|
package/dist/locale/i18n.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { i18nAssertValidResources, i18nCoreInit } 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
|
-
i18nAssertValidResources(enLocaleResources, "fr", frLocaleResources);
|
|
7
|
-
/**
|
|
8
|
-
* Utility resources.
|
|
9
|
-
*/
|
|
10
|
-
export const utilityResources = {
|
|
11
|
-
en: {
|
|
12
|
-
aidct_utility: enLocaleResources
|
|
13
|
-
},
|
|
14
|
-
fr: {
|
|
15
|
-
aidct_utility: frLocaleResources
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
// Explicit type is necessary to work around bug in type discovery with linked packages.
|
|
19
|
-
export const i18nextUtility = i18next.createInstance();
|
|
20
|
-
/**
|
|
21
|
-
* Initialize internationalization.
|
|
22
|
-
*
|
|
23
|
-
* @param environment
|
|
24
|
-
* Environment in which the application is running.
|
|
25
|
-
*
|
|
26
|
-
* @param debug
|
|
27
|
-
* Debug setting.
|
|
28
|
-
*
|
|
29
|
-
* @returns
|
|
30
|
-
* Void promise.
|
|
31
|
-
*/
|
|
32
|
-
export async function i18nUtilityInit(environment, debug = false) {
|
|
33
|
-
await i18nCoreInit(i18nextUtility, environment, debug, utilityNS, utilityResources);
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=i18n.js.map
|
package/dist/locale/i18n.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/locale/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAwB,MAAM,oBAAoB,CAAC;AAClG,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,wBAAwB,CAAC,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC;AAErE;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAa;IACtC,EAAE,EAAE;QACA,aAAa,EAAE,iBAAiB;KACnC;IACD,EAAE,EAAE;QACA,aAAa,EAAE,iBAAiB;KACnC;CACJ,CAAC;AAEF,wFAAwF;AACxF,MAAM,CAAC,MAAM,cAAc,GAAS,OAAO,CAAC,cAAc,EAAE,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,WAA4B,EAAE,KAAK,GAAG,KAAK;IAC7E,MAAM,YAAY,CAAC,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;AACxF,CAAC"}
|
package/dist/record.d.ts
DELETED
|
@@ -1,44 +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
|
-
/**
|
|
11
|
-
* Type name for error message.
|
|
12
|
-
*/
|
|
13
|
-
private readonly _typeName;
|
|
14
|
-
/**
|
|
15
|
-
* Record in which to look up keys.
|
|
16
|
-
*/
|
|
17
|
-
private readonly _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: string, record: Readonly<Record<string, T>>);
|
|
28
|
-
/**
|
|
29
|
-
* Get the type name.
|
|
30
|
-
*/
|
|
31
|
-
get typeName(): string;
|
|
32
|
-
/**
|
|
33
|
-
* Get the record.
|
|
34
|
-
*/
|
|
35
|
-
get record(): Readonly<Record<string, T>>;
|
|
36
|
-
/**
|
|
37
|
-
* Validate a key by looking it up in the record.
|
|
38
|
-
*
|
|
39
|
-
* @param key
|
|
40
|
-
* Record key.
|
|
41
|
-
*/
|
|
42
|
-
validate(key: string): void;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=record.d.ts.map
|
package/dist/record.d.ts.map
DELETED
|
@@ -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;IACtD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IAEtD;;;;;;;;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
|
package/dist/record.js.map
DELETED
|
@@ -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;IACc,SAAS,CAAS;IAEnC;;OAEG;IACc,OAAO,CAA8B;IAEtD;;;;;;;;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,43 +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>/\d*/</code> (0 or more digits) matches every string, <code>/\d+/</code>
|
|
5
|
-
* (1 or more digits) matches strings with at least one digit, <code>/^\d*$/</code> matches strings that
|
|
6
|
-
* are all digits or empty, and <code>/^\d+$/</code> matches strings that are all digits and not empty.
|
|
7
|
-
*
|
|
8
|
-
* Clients of this class are recommended to override the {@link createErrorMessage} method create a more suitable error
|
|
9
|
-
* message for their use case.
|
|
10
|
-
*/
|
|
11
|
-
export declare class RegExpValidator implements StringValidator {
|
|
12
|
-
/**
|
|
13
|
-
* Regular expression.
|
|
14
|
-
*/
|
|
15
|
-
private readonly _regExp;
|
|
16
|
-
/**
|
|
17
|
-
* Constructor.
|
|
18
|
-
*
|
|
19
|
-
* @param regExp
|
|
20
|
-
* Regular expression. See {@link RegExpValidator | class documentation} for notes.
|
|
21
|
-
*/
|
|
22
|
-
constructor(regExp: RegExp);
|
|
23
|
-
/**
|
|
24
|
-
* Get the regular expression.
|
|
25
|
-
*/
|
|
26
|
-
get regExp(): RegExp;
|
|
27
|
-
/**
|
|
28
|
-
* Create an error message for a string. The generic error message is sufficient for many use cases but a more
|
|
29
|
-
* domain-specific error message, possibly including the pattern itself, is often required.
|
|
30
|
-
*
|
|
31
|
-
* @param s
|
|
32
|
-
* String.
|
|
33
|
-
*
|
|
34
|
-
* @returns
|
|
35
|
-
* Error message.
|
|
36
|
-
*/
|
|
37
|
-
protected createErrorMessage(s: string): string;
|
|
38
|
-
/**
|
|
39
|
-
* @inheritDoc
|
|
40
|
-
*/
|
|
41
|
-
validate(s: string): void;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=reg-exp.d.ts.map
|
package/dist/reg-exp.d.ts.map
DELETED
|
@@ -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;IACnD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;;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>/\d*/</code> (0 or more digits) matches every string, <code>/\d+/</code>
|
|
5
|
-
* (1 or more digits) matches strings with at least one digit, <code>/^\d*$/</code> matches strings that
|
|
6
|
-
* are all digits or empty, and <code>/^\d+$/</code> matches strings that are all digits and not empty.
|
|
7
|
-
*
|
|
8
|
-
* Clients of this class are recommended to override the {@link createErrorMessage} method create a more suitable error
|
|
9
|
-
* 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
|
package/dist/reg-exp.js.map
DELETED
|
@@ -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;IACc,OAAO,CAAS;IAEjC;;;;;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"}
|
package/dist/sequence.d.ts
DELETED
|
@@ -1,68 +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
|
-
/**
|
|
6
|
-
* Start value (inclusive).
|
|
7
|
-
*/
|
|
8
|
-
private readonly _startValue;
|
|
9
|
-
/**
|
|
10
|
-
* End value (exclusive).
|
|
11
|
-
*/
|
|
12
|
-
private readonly _endValue;
|
|
13
|
-
/**
|
|
14
|
-
* Count of values.
|
|
15
|
-
*/
|
|
16
|
-
private readonly _count;
|
|
17
|
-
/**
|
|
18
|
-
* Delta to the next value; equal to the sign of the count.
|
|
19
|
-
*/
|
|
20
|
-
private readonly _nextDelta;
|
|
21
|
-
/**
|
|
22
|
-
* Minimum value (inclusive).
|
|
23
|
-
*/
|
|
24
|
-
private readonly _minimumValue;
|
|
25
|
-
/**
|
|
26
|
-
* Maximum value (inclusive).
|
|
27
|
-
*/
|
|
28
|
-
private readonly _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: number | bigint, count: number);
|
|
40
|
-
/**
|
|
41
|
-
* Get the start value (inclusive).
|
|
42
|
-
*/
|
|
43
|
-
get startValue(): bigint;
|
|
44
|
-
/**
|
|
45
|
-
* Get the end value (exclusive).
|
|
46
|
-
*/
|
|
47
|
-
get endValue(): bigint;
|
|
48
|
-
/**
|
|
49
|
-
* Get the count of values.
|
|
50
|
-
*/
|
|
51
|
-
get count(): number;
|
|
52
|
-
/**
|
|
53
|
-
* Get the minimum value (inclusive).
|
|
54
|
-
*/
|
|
55
|
-
get minimumValue(): bigint;
|
|
56
|
-
/**
|
|
57
|
-
* Get the maximum value (inclusive).
|
|
58
|
-
*/
|
|
59
|
-
get maximumValue(): bigint;
|
|
60
|
-
/**
|
|
61
|
-
* Iterable implementation.
|
|
62
|
-
*
|
|
63
|
-
* @yields
|
|
64
|
-
* Next value in sequence.
|
|
65
|
-
*/
|
|
66
|
-
[Symbol.iterator](): Generator<bigint>;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=sequence.d.ts.map
|
package/dist/sequence.d.ts.map
DELETED
|
@@ -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;IAC7C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IAErC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAW;IAEtC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IAEvC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IAEvC;;;;;;;;;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
|