@aidc-toolkit/utility 0.9.10-beta → 0.9.12-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/dist/index.cjs CHANGED
@@ -854,7 +854,7 @@ var CharacterSetValidator = class _CharacterSetValidator {
854
854
  * Array of indexes for each character or undefined if the character is not in the character set.
855
855
  */
856
856
  characterIndexes(s) {
857
- return [...s].map((c) => this._characterSetMap.get(c));
857
+ return Array.from(s).map((c) => this._characterSetMap.get(c));
858
858
  }
859
859
  /**
860
860
  * Convert a component definition to a string or undefined. Checks the type of the component and makes the callback
package/dist/index.d.cts CHANGED
@@ -868,7 +868,7 @@ declare class CharacterSetCreator extends CharacterSetValidator {
868
868
  * @returns
869
869
  * String(s) created from the value(s).
870
870
  */
871
- create<T extends TransformerInput<number | bigint>>(length: number, valueOrValues: T, exclusion?: Exclusion, tweak?: number | bigint, creatorCallback?: TransformerCallback<string, string>): TransformerOutput<T, string>;
871
+ create<TTransformerInput extends TransformerInput<number | bigint>>(length: number, valueOrValues: TTransformerInput, exclusion?: Exclusion, tweak?: number | bigint, creatorCallback?: TransformerCallback<string, string>): TransformerOutput<TTransformerInput, string>;
872
872
  /**
873
873
  * Determine the value for a string.
874
874
  *
package/dist/index.d.ts CHANGED
@@ -868,7 +868,7 @@ declare class CharacterSetCreator extends CharacterSetValidator {
868
868
  * @returns
869
869
  * String(s) created from the value(s).
870
870
  */
871
- create<T extends TransformerInput<number | bigint>>(length: number, valueOrValues: T, exclusion?: Exclusion, tweak?: number | bigint, creatorCallback?: TransformerCallback<string, string>): TransformerOutput<T, string>;
871
+ create<TTransformerInput extends TransformerInput<number | bigint>>(length: number, valueOrValues: TTransformerInput, exclusion?: Exclusion, tweak?: number | bigint, creatorCallback?: TransformerCallback<string, string>): TransformerOutput<TTransformerInput, string>;
872
872
  /**
873
873
  * Determine the value for a string.
874
874
  *
package/dist/index.js CHANGED
@@ -801,7 +801,7 @@ var CharacterSetValidator = class _CharacterSetValidator {
801
801
  * Array of indexes for each character or undefined if the character is not in the character set.
802
802
  */
803
803
  characterIndexes(s) {
804
- return [...s].map((c) => this._characterSetMap.get(c));
804
+ return Array.from(s).map((c) => this._characterSetMap.get(c));
805
805
  }
806
806
  /**
807
807
  * Convert a component definition to a string or undefined. Checks the type of the component and makes the callback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/utility",
3
- "version": "0.9.10-beta",
3
+ "version": "0.9.12-beta",
4
4
  "description": "Foundational utilities for AIDC Toolkit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -25,15 +25,16 @@
25
25
  "test": "vitest run"
26
26
  },
27
27
  "devDependencies": {
28
- "@aidc-toolkit/dev": "^0.9.10-beta",
29
- "eslint": "^9.17.0",
28
+ "@aidc-toolkit/dev": "^0.9.12-beta",
29
+ "eslint": "^9.20.1",
30
+ "jiti": "^2.4.2",
30
31
  "ts-node": "^10.9.2",
31
- "tsup": "^8.3.5",
32
- "typescript": "^5.7.2",
33
- "vitest": "^2.1.8"
32
+ "tsup": "^8.3.6",
33
+ "typescript": "^5.7.3",
34
+ "vitest": "^3.0.5"
34
35
  },
35
36
  "dependencies": {
36
- "@aidc-toolkit/core": "^0.9.10-beta",
37
- "i18next": "^24.2.1"
37
+ "@aidc-toolkit/core": "^0.9.12-beta",
38
+ "i18next": "^24.2.2"
38
39
  }
39
40
  }
@@ -172,7 +172,7 @@ export class CharacterSetValidator implements StringValidator<CharacterSetValida
172
172
  * Array of indexes for each character or undefined if the character is not in the character set.
173
173
  */
174
174
  characterIndexes(s: string): ReadonlyArray<number | undefined> {
175
- return [...s].map(c => this._characterSetMap.get(c));
175
+ return Array.from(s).map(c => this._characterSetMap.get(c));
176
176
  }
177
177
 
178
178
  /**
@@ -550,7 +550,7 @@ export class CharacterSetCreator extends CharacterSetValidator {
550
550
  * @returns
551
551
  * String(s) created from the value(s).
552
552
  */
553
- create<T extends TransformerInput<number | bigint>>(length: number, valueOrValues: T, exclusion: Exclusion = Exclusion.None, tweak?: number | bigint, creatorCallback?: TransformerCallback<string, string>): TransformerOutput<T, string> {
553
+ create<TTransformerInput extends TransformerInput<number | bigint>>(length: number, valueOrValues: TTransformerInput, exclusion: Exclusion = Exclusion.None, tweak?: number | bigint, creatorCallback?: TransformerCallback<string, string>): TransformerOutput<TTransformerInput, string> {
554
554
  this.validateLength(length);
555
555
  this.validateExclusion(exclusion);
556
556
 
@@ -113,7 +113,10 @@ describe("Encryption", () => {
113
113
  testTransformer(10, 1);
114
114
  });
115
115
 
116
- test("Large domain and tweak", () => {
116
+ test("Large domain and tweak", {
117
+ // Test can take a long time.
118
+ timeout: 2 * 60 * 1000
119
+ }, () => {
117
120
  testTransformer(100000, 123456);
118
121
  });
119
122
 
File without changes