@aidc-toolkit/utility 1.0.46 → 1.0.47-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.
Files changed (57) hide show
  1. package/dist/character-set.d.ts +242 -0
  2. package/dist/character-set.d.ts.map +1 -0
  3. package/dist/character-set.js +542 -0
  4. package/dist/character-set.js.map +1 -0
  5. package/dist/exclusion.d.ts +26 -0
  6. package/dist/exclusion.d.ts.map +1 -0
  7. package/dist/exclusion.js +18 -0
  8. package/dist/exclusion.js.map +1 -0
  9. package/dist/index.d.ts +26 -699
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +9 -1
  12. package/dist/index.js.map +1 -0
  13. package/dist/iterable-utility.d.ts +39 -0
  14. package/dist/iterable-utility.d.ts.map +1 -0
  15. package/dist/iterable-utility.js +35 -0
  16. package/dist/iterable-utility.js.map +1 -0
  17. package/dist/locale/en/locale-resources.d.ts +33 -0
  18. package/dist/locale/en/locale-resources.d.ts.map +1 -0
  19. package/dist/locale/en/locale-resources.js +32 -0
  20. package/dist/locale/en/locale-resources.js.map +1 -0
  21. package/dist/locale/fr/locale-resources.d.ts +33 -0
  22. package/dist/locale/fr/locale-resources.d.ts.map +1 -0
  23. package/dist/locale/fr/locale-resources.js +32 -0
  24. package/dist/locale/fr/locale-resources.js.map +1 -0
  25. package/dist/locale/i18n.d.ts +27 -0
  26. package/dist/locale/i18n.d.ts.map +1 -0
  27. package/dist/locale/i18n.js +34 -0
  28. package/dist/locale/i18n.js.map +1 -0
  29. package/dist/record.d.ts +37 -0
  30. package/dist/record.d.ts.map +1 -0
  31. package/dist/record.js +58 -0
  32. package/dist/record.js.map +1 -0
  33. package/dist/reg-exp.d.ts +40 -0
  34. package/dist/reg-exp.d.ts.map +1 -0
  35. package/dist/reg-exp.js +55 -0
  36. package/dist/reg-exp.js.map +1 -0
  37. package/dist/sequence.d.ts +45 -0
  38. package/dist/sequence.d.ts.map +1 -0
  39. package/dist/sequence.js +96 -0
  40. package/dist/sequence.js.map +1 -0
  41. package/dist/string.d.ts +25 -0
  42. package/dist/string.d.ts.map +1 -0
  43. package/dist/string.js +2 -0
  44. package/dist/string.js.map +1 -0
  45. package/dist/transformer.d.ts +191 -0
  46. package/dist/transformer.d.ts.map +1 -0
  47. package/dist/transformer.js +459 -0
  48. package/dist/transformer.js.map +1 -0
  49. package/dist/version.d.ts +5 -0
  50. package/dist/version.d.ts.map +1 -0
  51. package/dist/version.js +5 -0
  52. package/dist/version.js.map +1 -0
  53. package/package.json +3 -3
  54. package/src/version.ts +1 -1
  55. package/tsconfig-src.tsbuildinfo +1 -1
  56. package/dist/index.cjs +0 -17
  57. package/dist/index.d.cts +0 -699
@@ -0,0 +1,459 @@
1
+ import { mapIterable } from "./iterable-utility.js";
2
+ import { i18nextUtility } from "./locale/i18n.js";
3
+ import { Sequence } from "./sequence.js";
4
+ /**
5
+ * Transformer that transforms values in a numeric domain to values in a range equal to the domain or to another range
6
+ * defined by a callback function. In other words, the domain determines valid input values and, without a callback, the
7
+ * range of valid output values.
8
+ *
9
+ * The concept is similar to {@link https://en.wikipedia.org/wiki/Format-preserving_encryption | format-preserving
10
+ * encryption}, where input values within a specified domain (e.g., {@link
11
+ * https://en.wikipedia.org/wiki/Payment_card_number | payment card numbers} ranging from 8-19 digits) are transformed
12
+ * into values in the same domain, typically for storage in a database where the data type and length are already fixed
13
+ * and exfiltration of the data can have significant repercussions.
14
+ *
15
+ * Two subclasses are supported directly by this class: {@linkcode IdentityTransformer} (which operates based on a
16
+ * domain only) and {@linkcode EncryptionTransformer} (which operates based on a domain and a tweak). If an application
17
+ * is expected to make repeated use of a transformer with the same domain and (optional) tweak and can't manage the
18
+ * transformer object, an in-memory cache is available via the {@linkcode get | get()} method. Properties in {@linkcode
19
+ * IdentityTransformer} and {@linkcode EncryptionTransformer} are read-only once constructed, so there is no issue with
20
+ * their shared use.
21
+ */
22
+ export class Transformer {
23
+ /**
24
+ * Transformers cache, mapping a domain to another map, which maps an optional tweak to a transformer.
25
+ */
26
+ static #TRANSFORMER_MAPS_MAP = new Map();
27
+ /**
28
+ * Domain.
29
+ */
30
+ #domain;
31
+ /**
32
+ * Constructor.
33
+ *
34
+ * @param domain
35
+ * Domain.
36
+ */
37
+ constructor(domain) {
38
+ this.#domain = BigInt(domain);
39
+ if (this.#domain <= 0n) {
40
+ throw new RangeError(i18nextUtility.t("Transformer.domainMustBeGreaterThanZero", {
41
+ domain
42
+ }));
43
+ }
44
+ }
45
+ /**
46
+ * Get a transformer, constructing it if necessary. The type returned is {@linkcode IdentityTransformer} if tweak is
47
+ * undefined, {@linkcode EncryptionTransformer} if tweak is defined. Note that although an {@linkcode
48
+ * EncryptionTransformer} with a zero tweak operates as an {@linkcode IdentityTransformer}, {@linkcode
49
+ * EncryptionTransformer} is still the type returned if a zero tweak is explicitly specified.
50
+ *
51
+ * @param domain
52
+ * Domain.
53
+ *
54
+ * @param tweak
55
+ * Tweak.
56
+ *
57
+ * @returns
58
+ * Transformer.
59
+ */
60
+ static get(domain, tweak) {
61
+ const domainN = BigInt(domain);
62
+ let transformersMap = Transformer.#TRANSFORMER_MAPS_MAP.get(domainN);
63
+ if (transformersMap === undefined) {
64
+ transformersMap = new Map();
65
+ Transformer.#TRANSFORMER_MAPS_MAP.set(domainN, transformersMap);
66
+ }
67
+ const tweakN = tweak === undefined ? undefined : BigInt(tweak);
68
+ let transformer = transformersMap.get(tweakN);
69
+ if (transformer === undefined) {
70
+ transformer = tweakN === undefined ? new IdentityTransformer(domainN) : new EncryptionTransformer(domainN, tweakN);
71
+ transformersMap.set(tweakN, transformer);
72
+ }
73
+ return transformer;
74
+ }
75
+ /**
76
+ * Get the domain.
77
+ */
78
+ get domain() {
79
+ return this.#domain;
80
+ }
81
+ /**
82
+ * Validate that a value is within the domain.
83
+ *
84
+ * @param value
85
+ * Value.
86
+ */
87
+ #validate(value) {
88
+ if (value < 0n) {
89
+ throw new RangeError(i18nextUtility.t("Transformer.valueMustBeGreaterThanOrEqualToZero", {
90
+ value
91
+ }));
92
+ }
93
+ if (value >= this.domain) {
94
+ throw new RangeError(i18nextUtility.t("Transformer.valueMustBeLessThan", {
95
+ value,
96
+ domain: this.domain
97
+ }));
98
+ }
99
+ }
100
+ /**
101
+ * Validate that a value is within the domain and do the work of transforming it forward.
102
+ *
103
+ * @param value
104
+ * Value.
105
+ *
106
+ * @returns
107
+ * Transformed value.
108
+ */
109
+ #validateDoForward(value) {
110
+ const valueN = BigInt(value);
111
+ this.#validate(valueN);
112
+ return this.doForward(valueN);
113
+ }
114
+ /**
115
+ * Validate that a value is within the domain, do the work of transforming it forward, and apply a callback.
116
+ *
117
+ * @param transformerCallback
118
+ * Called after each value is transformed to convert it to its final value.
119
+ *
120
+ * @param value
121
+ * Value.
122
+ *
123
+ * @param index
124
+ * Index in sequence (0 for single transformation).
125
+ *
126
+ * @returns
127
+ * Transformed value.
128
+ */
129
+ #validateDoForwardCallback(transformerCallback, value, index) {
130
+ return transformerCallback(this.#validateDoForward(value), index);
131
+ }
132
+ ;
133
+ // eslint-disable-next-line jsdoc/require-jsdoc -- Implementation of overloaded signatures.
134
+ forward(valueOrValues, transformerCallback) {
135
+ let result;
136
+ if (typeof valueOrValues !== "object") {
137
+ result = transformerCallback === undefined ? this.#validateDoForward(valueOrValues) : this.#validateDoForwardCallback(transformerCallback, valueOrValues);
138
+ }
139
+ else if (valueOrValues instanceof Sequence) {
140
+ if (valueOrValues.minimumValue < 0n) {
141
+ throw new RangeError(i18nextUtility.t("Transformer.minimumValueMustBeGreaterThanOrEqualToZero", {
142
+ minimumValue: valueOrValues.minimumValue
143
+ }));
144
+ }
145
+ if (valueOrValues.maximumValue >= this.domain) {
146
+ throw new RangeError(i18nextUtility.t("Transformer.maximumValueMustBeLessThan", {
147
+ maximumValue: valueOrValues.maximumValue,
148
+ domain: this.domain
149
+ }));
150
+ }
151
+ result = transformerCallback === undefined ? mapIterable(valueOrValues, value => this.doForward(value)) : mapIterable(valueOrValues, (value, index) => transformerCallback(this.doForward(value), index));
152
+ }
153
+ else {
154
+ result = transformerCallback === undefined ? mapIterable(valueOrValues, value => this.#validateDoForward(value)) : mapIterable(valueOrValues, (value, index) => this.#validateDoForwardCallback(transformerCallback, value, index));
155
+ }
156
+ return result;
157
+ }
158
+ /**
159
+ * Transform a value in reverse.
160
+ *
161
+ * @param transformedValue
162
+ * Transformed value.
163
+ *
164
+ * @returns
165
+ * Value.
166
+ */
167
+ reverse(transformedValue) {
168
+ const transformedValueN = BigInt(transformedValue);
169
+ this.#validate(transformedValueN);
170
+ return this.doReverse(transformedValueN);
171
+ }
172
+ }
173
+ /**
174
+ * Identity transformer. Values are transformed to themselves.
175
+ */
176
+ export class IdentityTransformer extends Transformer {
177
+ /**
178
+ * @inheritDoc
179
+ */
180
+ doForward(value) {
181
+ return value;
182
+ }
183
+ /**
184
+ * @inheritDoc
185
+ */
186
+ doReverse(transformedValue) {
187
+ return transformedValue;
188
+ }
189
+ }
190
+ /**
191
+ * Encryption transformer. Values are transformed using repeated shuffle and xor operations, similar to those found in
192
+ * many cryptography algorithms, particularly AES. While sufficient for obfuscation of numeric sequences (e.g., serial
193
+ * number generation, below), if true format-preserving encryption is required, a more robust algorithm such as {@link
194
+ * https://doi.org/10.6028/NIST.SP.800-38Gr1.2pd | FF1} is recommended. Furthermore, no work has been done to mitigate
195
+ * {@link https://timing.attacks.cr.yp.to/index.html | timing attacks} for key detection.
196
+ *
197
+ * The purpose of the encryption transformer is to generate pseudo-random values in a deterministic manner to obscure
198
+ * the sequence of values generated over time. A typical example is for serial number generation, where knowledge of the
199
+ * sequence can infer production volumes (e.g., serial number 1000 implies that at least 1,000 units have been
200
+ * manufactured) or can be used in counterfeiting (e.g., a counterfeiter can generate serial numbers 1001, 1002, ...
201
+ * with reasonable confidence that they would be valid if queried).
202
+ *
203
+ * The domain and the tweak together determine the encryption key, which in turn determines the number of rounds of
204
+ * shuffle and xor operations. The minimum number of rounds is 4, except where the domain is less than or equal to 256,
205
+ * which results in single-byte operations. To ensure that the operations are effective for single-byte domains, the
206
+ * number of rounds is 1 and only the xor operation is applied (shuffling a single byte is an identity operation).
207
+ *
208
+ * Another exception is when there is a tweak value of 0; this results in identity operations where the output value is
209
+ * identical to the input value, as no shuffle or xor takes place.
210
+ */
211
+ export class EncryptionTransformer extends Transformer {
212
+ /**
213
+ * Encryption seed; an 8-digit prime to force at least four rounds.
214
+ */
215
+ static #SEED = 603868999n;
216
+ /**
217
+ * Individual bits, pre-calculated for performance.
218
+ */
219
+ static #BITS = new Uint8Array([
220
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
221
+ ]);
222
+ /**
223
+ * Inverse individual bits, pre-calculated for performance.
224
+ */
225
+ static #INVERSE_BITS = new Uint8Array([
226
+ 0xFE, 0xFD, 0xFB, 0xF7, 0xEF, 0xDF, 0xBF, 0x7F
227
+ ]);
228
+ /**
229
+ * Number of bytes covered by the domain.
230
+ */
231
+ #domainBytes;
232
+ /**
233
+ * Xor bytes array generated from the domain and tweak.
234
+ */
235
+ #xorBytes;
236
+ /**
237
+ * Bits array generated from the domain and tweak.
238
+ */
239
+ #bits;
240
+ /**
241
+ * Inverse bits array generated from the domain and tweak.
242
+ */
243
+ #inverseBits;
244
+ /**
245
+ * Number of rounds (length of arrays) generated from the domain and tweak.
246
+ */
247
+ #rounds;
248
+ /**
249
+ * Constructor.
250
+ *
251
+ * @param domain
252
+ * Domain.
253
+ *
254
+ * @param tweak
255
+ * Tweak.
256
+ */
257
+ constructor(domain, tweak) {
258
+ super(domain);
259
+ if (tweak < 0n) {
260
+ throw new RangeError(i18nextUtility.t("Transformer.tweakMustBeGreaterThanOrEqualToZero", {
261
+ tweak
262
+ }));
263
+ }
264
+ let domainBytes = 0;
265
+ // The number of bytes in the domain determines the size of the shuffle and xor operations.
266
+ for (let reducedDomainMinusOne = this.domain - 1n; reducedDomainMinusOne !== 0n; reducedDomainMinusOne >>= 8n) {
267
+ domainBytes++;
268
+ }
269
+ this.#domainBytes = domainBytes;
270
+ const xorBytes = [];
271
+ const bits = [];
272
+ const inverseBits = [];
273
+ // Key is the product of domain, tweak, and seed.
274
+ for (let reducedKey = this.domain * BigInt(tweak) * EncryptionTransformer.#SEED; reducedKey !== 0n; reducedKey >>= 8n) {
275
+ // Extract the least significant byte.
276
+ xorBytes.unshift(Number(BigInt.asUintN(8, reducedKey)));
277
+ // Bit number is the reduced key mod 8.
278
+ const bitNumber = Number(BigInt.asUintN(3, reducedKey));
279
+ // Bits are applied in reverse order so that they don't correlate directly with the key bytes at the same index.
280
+ bits.push(EncryptionTransformer.#BITS[bitNumber]);
281
+ inverseBits.push(EncryptionTransformer.#INVERSE_BITS[bitNumber]);
282
+ }
283
+ // Domains occupying a single byte will not shuffle and will map all values to themselves for very small domains.
284
+ if (domainBytes === 1) {
285
+ // Determine the lowest possible mask that will cover all values in the domain.
286
+ const domainMask = EncryptionTransformer.#BITS.filter(bit => bit < domain).reduce((accumulator, bit) => accumulator | bit, 0);
287
+ // Reduce all xor bytes to a single byte and strip higher bits.
288
+ this.#xorBytes = new Uint8Array([xorBytes.reduce((accumulator, xorByte) => accumulator ^ xorByte, 0) & domainMask]);
289
+ // Bits and inverse bits are irrelevant as there will be no shuffling; choose first bit arbitrarily.
290
+ this.#bits = new Uint8Array([EncryptionTransformer.#BITS[0]]);
291
+ this.#inverseBits = new Uint8Array([EncryptionTransformer.#INVERSE_BITS[0]]);
292
+ // Everything will be done in one round.
293
+ this.#rounds = 1;
294
+ }
295
+ else {
296
+ this.#xorBytes = new Uint8Array(xorBytes);
297
+ this.#bits = new Uint8Array(bits);
298
+ this.#inverseBits = new Uint8Array(inverseBits);
299
+ this.#rounds = xorBytes.length;
300
+ }
301
+ }
302
+ /**
303
+ * Convert a value to a byte array big enough to handle the entire domain.
304
+ *
305
+ * @param value
306
+ * Value.
307
+ *
308
+ * @returns
309
+ * Big-endian byte array equivalent to the value.
310
+ */
311
+ #valueToBytes(value) {
312
+ const bytes = new Uint8Array(this.#domainBytes);
313
+ // Build byte array in reverse order to get as big-endian.
314
+ for (let index = this.#domainBytes - 1, reducedValue = value; index >= 0 && reducedValue !== 0n; index--, reducedValue >>= 8n) {
315
+ bytes[index] = Number(BigInt.asUintN(8, reducedValue));
316
+ }
317
+ return bytes;
318
+ }
319
+ /**
320
+ * Convert a byte array to a value.
321
+ *
322
+ * @param bytes
323
+ * Big-endian byte array equivalent to the value.
324
+ *
325
+ * @returns
326
+ * Value.
327
+ */
328
+ static #bytesToValue(bytes) {
329
+ return bytes.reduce((accumulator, byte) => accumulator << 8n | BigInt(byte), 0n);
330
+ }
331
+ /**
332
+ * Shuffle a byte array.
333
+ *
334
+ * The input array to the forward operation (output from the reverse operation) is `bytes` and the output array from
335
+ * the forward operation (input to the reverse operation) is `bytes'`.
336
+ *
337
+ * The shuffle operation starts by testing the bit at `bits[round]` for each `byte` in `bytes`. The indexes for all
338
+ * bytes with that bit set are put into one array (`shuffleIndexes1`) and the rest are put into another
339
+ * (`shuffleIndexes0`). The two arrays are concatenated and used to shuffle the input array, using their values
340
+ * (`shuffleIndex`) and the indexes of those values (`index`) in the concatenated array.
341
+ *
342
+ * Forward shuffling moves the entry at `shuffleIndex` to the `index` position.
343
+ *
344
+ * Reverse shuffling moves the entry at `index` to the `shuffleIndex` position.
345
+ *
346
+ * As each byte is moved, the bit at `bits[round]` is preserved in its original position. This ensures that the
347
+ * process is reversible.
348
+ *
349
+ * @param bytes
350
+ * Byte array.
351
+ *
352
+ * @param round
353
+ * Round number.
354
+ *
355
+ * @param forward
356
+ * True if operating forward (encrypting), false if operating in reverse (decrypting).
357
+ *
358
+ * @returns
359
+ * Shuffled byte array.
360
+ */
361
+ #shuffle(bytes, round, forward) {
362
+ const bytesLength = bytes.length;
363
+ const determinants = new Uint8Array(bytesLength);
364
+ const shuffleIndexes1 = [];
365
+ const shuffleIndexes0 = [];
366
+ const bit = this.#bits[round];
367
+ bytes.forEach((byte, index) => {
368
+ const determinant = byte & bit;
369
+ determinants[index] = determinant;
370
+ // Place byte in array chosen by bit state.
371
+ (determinant !== 0 ? shuffleIndexes1 : shuffleIndexes0).push(index);
372
+ });
373
+ const inverseBit = this.#inverseBits[round];
374
+ const shuffleBytes = new Uint8Array(bytesLength);
375
+ // Concatenate shuffle indexes arrays and complete shuffle.
376
+ [...shuffleIndexes1, ...shuffleIndexes0].forEach((shuffleIndex, index) => {
377
+ if (forward) {
378
+ shuffleBytes[index] = (bytes[shuffleIndex] & inverseBit) | determinants[index];
379
+ }
380
+ else {
381
+ shuffleBytes[shuffleIndex] = (bytes[index] & inverseBit) | determinants[shuffleIndex];
382
+ }
383
+ });
384
+ return shuffleBytes;
385
+ }
386
+ /**
387
+ * Xor a byte array.
388
+ *
389
+ * The input array to the forward operation (output from the reverse operation) is `bytes` and the output array from
390
+ * the forward operation (input to the reverse operation) is `bytes'`.
391
+ *
392
+ * Forward:
393
+ * - `bytes'[0] = bytes[0] ^ xorBytes[round]`
394
+ * - `bytes'[1] = bytes[1] ^ bytes'[0]`
395
+ * - `bytes'[2] = bytes[2] ^ bytes'[1]`
396
+ * - `...`
397
+ * - `bytes'[domainBytes - 1] = bytes[domainBytes - 1] ^ bytes'[domainBytes - 2]`
398
+ *
399
+ * Reverse:
400
+ * - `bytes[0] = bytes'[0] ^ xorBytes[round]`
401
+ * - `bytes[1] = bytes'[1] ^ bytes'[0]`
402
+ * - `bytes[2] = bytes'[2] ^ bytes'[1]`
403
+ * - `...`
404
+ * - `bytes[domainBytes - 1] = bytes'[domainBytes - 1] ^ bytes'[domainBytes - 2]`
405
+ *
406
+ * @param bytes
407
+ * Byte array.
408
+ *
409
+ * @param round
410
+ * Round number.
411
+ *
412
+ * @param forward
413
+ * True if operating forward (encrypting), false if operating in reverse (decrypting).
414
+ *
415
+ * @returns
416
+ * Xored byte array.
417
+ */
418
+ #xor(bytes, round, forward) {
419
+ let cumulativeXorByte = this.#xorBytes[round];
420
+ return bytes.map((byte) => {
421
+ const xorByte = byte ^ cumulativeXorByte;
422
+ cumulativeXorByte = forward ? xorByte : byte;
423
+ return xorByte;
424
+ });
425
+ }
426
+ /**
427
+ * @inheritDoc
428
+ */
429
+ doForward(value) {
430
+ let bytes = this.#valueToBytes(value);
431
+ let transformedValue;
432
+ // Loop repeats until transformed value is within domain.
433
+ do {
434
+ // Forward operation is shuffle then xor for the number of rounds.
435
+ for (let round = 0; round < this.#rounds; round++) {
436
+ bytes = this.#xor(this.#shuffle(bytes, round, true), round, true);
437
+ }
438
+ transformedValue = EncryptionTransformer.#bytesToValue(bytes);
439
+ } while (transformedValue >= this.domain);
440
+ return transformedValue;
441
+ }
442
+ /**
443
+ * @inheritDoc
444
+ */
445
+ doReverse(transformedValue) {
446
+ let bytes = this.#valueToBytes(transformedValue);
447
+ let value;
448
+ // Loop repeats until value is within domain.
449
+ do {
450
+ // Reverse operation is xor then shuffle for the number of rounds in reverse.
451
+ for (let round = this.#rounds - 1; round >= 0; round--) {
452
+ bytes = this.#shuffle(this.#xor(bytes, round, false), round, false);
453
+ }
454
+ value = EncryptionTransformer.#bytesToValue(bytes);
455
+ } while (value >= this.domain);
456
+ return value;
457
+ }
458
+ }
459
+ //# sourceMappingURL=transformer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformer.js","sourceRoot":"","sources":["../src/transformer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAgB,WAAW;IAC7B;;OAEG;IACH,MAAM,CAAU,qBAAqB,GAAG,IAAI,GAAG,EAAgD,CAAC;IAEhG;;OAEG;IACM,OAAO,CAAS;IAEzB;;;;;OAKG;IACH,YAAY,MAAuB;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAE9B,IAAI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,IAAI,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QACjD,IAAI,KAAa,CAAC;QAElB,6CAA6C;QAC7C,GAAG,CAAC;YACA,6EAA6E;YAC7E,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;gBACrD,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YACxE,CAAC;YAED,KAAK,GAAG,qBAAqB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACvD,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;QAE/B,OAAO,KAAK,CAAC;IACjB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Repository version, updated automatically during publication.
3
+ */
4
+ export declare const VERSION = "1.0.47-beta";
5
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Repository version, updated automatically during publication.
3
+ */
4
+ export const VERSION = "1.0.47-beta";
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/utility",
3
- "version": "1.0.46",
3
+ "version": "1.0.47-beta",
4
4
  "description": "Foundational utilities for AIDC Toolkit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,10 +29,10 @@
29
29
  "test": "tsc --project tsconfig-test.json --noEmit && vitest run"
30
30
  },
31
31
  "devDependencies": {
32
- "@aidc-toolkit/dev": "^1.0.44",
32
+ "@aidc-toolkit/dev": "1.0.45-beta",
33
33
  "vitest": "^4.0.18"
34
34
  },
35
35
  "dependencies": {
36
- "@aidc-toolkit/core": "^1.0.45"
36
+ "@aidc-toolkit/core": "1.0.46-beta"
37
37
  }
38
38
  }
package/src/version.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Repository version, updated automatically during publication.
3
3
  */
4
- export const VERSION = "1.0.46";
4
+ export const VERSION = "1.0.47-beta";