@aidc-toolkit/gs1 0.9.16-beta → 0.9.17-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/gs1.iml ADDED
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/gs1",
3
- "version": "0.9.16-beta",
3
+ "version": "0.9.17-beta",
4
4
  "description": "GS1 AIDC Toolkit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,22 +19,20 @@
19
19
  "url": "https://www.linkedin.com/in/kdean"
20
20
  },
21
21
  "scripts": {
22
- "update-aidc-toolkit": "npm update @aidc-toolkit/dev @aidc-toolkit/core @aidc-toolkit/utility",
23
22
  "lint": "eslint",
24
23
  "build:core": "rimraf dist && tsc --project",
25
24
  "build:dev": "npm run build:core -- node_modules/@aidc-toolkit/dev/tsconfig-build-dev.json",
26
25
  "build:release": "npm run build:core -- node_modules/@aidc-toolkit/dev/tsconfig-build.json",
27
26
  "build:doc": "npm run build:dev",
28
- "publish-dev": "publish-dev",
29
27
  "test": "vitest run"
30
28
  },
31
29
  "devDependencies": {
32
- "@aidc-toolkit/dev": "^0.9.16-beta",
30
+ "@aidc-toolkit/dev": "^0.9.17-beta",
33
31
  "vitest": "^3.0.7"
34
32
  },
35
33
  "dependencies": {
36
- "@aidc-toolkit/core": "^0.9.16-beta",
37
- "@aidc-toolkit/utility": "^0.9.16-beta",
34
+ "@aidc-toolkit/core": "^0.9.17-beta",
35
+ "@aidc-toolkit/utility": "^0.9.17-beta",
38
36
  "i18next": "^24.2.2",
39
37
  "ts-mixer": "^6.0.4"
40
38
  }
@@ -10,7 +10,7 @@ import {
10
10
  hasValidCheckCharacterPair,
11
11
  hasValidCheckDigit,
12
12
  i18nGS1Init
13
- } from "../src/index.js";
13
+ } from "../src";
14
14
 
15
15
  await i18nGS1Init(I18NEnvironment.CLI, true);
16
16
 
@@ -40,7 +40,7 @@ import {
40
40
  type SerializableNumericIdentificationKeyCreator,
41
41
  type SerializableNumericIdentificationKeyValidator,
42
42
  SSCC_VALIDATOR
43
- } from "../src/index.js";
43
+ } from "../src";
44
44
 
45
45
  await i18nGS1Init(I18NEnvironment.CLI);
46
46
 
@@ -427,20 +427,20 @@ function testNumericIdentificationKeyCreator(creator: NumericIdentificationKeyCr
427
427
  expect(creator.referenceLength).toBe(referenceLength);
428
428
  expect(creator.capacity).toBe(Number(CharacterSetCreator.powerOf10(referenceLength)));
429
429
 
430
- const sequenceIterator = Iterator.from(creator.create(new Sequence(0, referenceCount)));
430
+ const sequenceIterator = creator.create(new Sequence(0, referenceCount))[Symbol.iterator]();
431
431
 
432
- let allCount = 0;
432
+ let index = 0;
433
433
 
434
- Iterator.from(creator.createAll()).forEach((identificationKey, index) => {
434
+ for (const identificationKey of creator.createAll()) {
435
435
  validate(identificationKey, index, false);
436
436
 
437
437
  expect(Number((hasExtensionDigit ? identificationKey.charAt(0) : "") + identificationKey.substring(referenceSubstringStart, referenceSubstringEnd))).toBe(index);
438
438
  expect(sequenceIterator.next().value).toBe(identificationKey);
439
439
 
440
- allCount++;
441
- });
440
+ index++;
441
+ }
442
442
 
443
- expect(allCount).toBe(referenceCount);
443
+ expect(index).toBe(referenceCount);
444
444
  expect(sequenceIterator.next().value).toBeUndefined();
445
445
 
446
446
  const randomValues = new Array<number>();
@@ -464,9 +464,9 @@ function testNumericIdentificationKeyCreator(creator: NumericIdentificationKeyCr
464
464
 
465
465
  const sequenceSet = new Set<string>();
466
466
 
467
- let sequenceCount = 0;
467
+ let index = 0;
468
468
 
469
- Iterator.from(creator.create(new Sequence(0, sparseReferenceCount), true)).forEach((identificationKey, index) => {
469
+ for (const identificationKey of creator.create(new Sequence(0, sparseReferenceCount), true)) {
470
470
  validate(identificationKey, index, true);
471
471
 
472
472
  sequential &&= Number((hasExtensionDigit ? identificationKey.charAt(0) : "") + identificationKey.substring(referenceSubstringStart, referenceSubstringEnd)) === index;
@@ -474,11 +474,11 @@ function testNumericIdentificationKeyCreator(creator: NumericIdentificationKeyCr
474
474
  expect(sequenceSet.has(identificationKey)).toBe(false);
475
475
  sequenceSet.add(identificationKey);
476
476
 
477
- sequenceCount++;
478
- });
477
+ index++;
478
+ }
479
479
 
480
480
  expect(sequential).toBe(false);
481
- expect(sequenceCount).toBe(sparseReferenceCount);
481
+ expect(index).toBe(sparseReferenceCount);
482
482
 
483
483
  const randomValues = new Array<number>();
484
484
  const identificationKeys = new Array<string>();
@@ -565,17 +565,17 @@ function testGTINCreator(creator: GTINCreator): void {
565
565
  }
566
566
 
567
567
  test("GTIN-14 straight", () => {
568
- let sequenceCount = 0;
568
+ let index = 0;
569
569
 
570
- Iterator.from(creator.createGTIN14("5", new Sequence(0, referenceCount))).forEach((gtin, index) => {
570
+ for (const gtin of creator.createGTIN14("5", new Sequence(0, referenceCount))) {
571
571
  expect(Number(gtin.substring(referenceSubstringStart, referenceSubstringEnd))).toBe(index);
572
572
 
573
573
  validate(gtin, index, false);
574
574
 
575
- sequenceCount++;
576
- });
575
+ index++;
576
+ }
577
577
 
578
- expect(sequenceCount).toBe(referenceCount);
578
+ expect(index).toBe(referenceCount);
579
579
 
580
580
  const randomValues = new Array<number>();
581
581
  const identificationKeys = new Array<string>();
@@ -598,9 +598,9 @@ function testGTINCreator(creator: GTINCreator): void {
598
598
 
599
599
  const sequenceSet = new Set<string>();
600
600
 
601
- let sequenceCount = 0;
601
+ let index = 0;
602
602
 
603
- Iterator.from(creator.createGTIN14("5", new Sequence(0, sparseReferenceCount), true)).forEach((gtin, index) => {
603
+ for (const gtin of creator.createGTIN14("5", new Sequence(0, sparseReferenceCount), true)) {
604
604
  sequential &&= Number(gtin.substring(referenceSubstringStart, referenceSubstringEnd)) === index;
605
605
 
606
606
  validate(gtin, index, true);
@@ -608,11 +608,11 @@ function testGTINCreator(creator: GTINCreator): void {
608
608
  expect(sequenceSet.has(gtin)).toBe(false);
609
609
  sequenceSet.add(gtin);
610
610
 
611
- sequenceCount++;
612
- });
611
+ index++;
612
+ }
613
613
 
614
614
  expect(sequential).toBe(false);
615
- expect(sequenceCount).toBe(sparseReferenceCount);
615
+ expect(index).toBe(sparseReferenceCount);
616
616
 
617
617
  const randomValues = new Array<number>();
618
618
  const identificationKeys = new Array<string>();
@@ -943,9 +943,9 @@ function testNonNumericIdentificationKeyCreator(creator: NonNumericIdentificatio
943
943
  test("Straight", () => {
944
944
  expect(creator.referenceLength).toBe(referenceLength);
945
945
 
946
- let sequenceCount = 0;
946
+ let index = 0;
947
947
 
948
- Iterator.from(creator.create(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, new Sequence(0, referenceCount)))).forEach((identificationKey, index) => {
948
+ for (const identificationKey of creator.create(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, new Sequence(0, referenceCount)))) {
949
949
  expect(() => {
950
950
  creator.validate(identificationKey);
951
951
  }).not.toThrow(RangeError);
@@ -958,18 +958,18 @@ function testNonNumericIdentificationKeyCreator(creator: NonNumericIdentificatio
958
958
 
959
959
  expect(identificationKey).toBe(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, index, Exclusion.None, undefined, reference => creator.create(reference)));
960
960
 
961
- sequenceCount++;
962
- });
961
+ index++;
962
+ }
963
963
 
964
- expect(sequenceCount).toBe(referenceCount);
964
+ expect(index).toBe(referenceCount);
965
965
  });
966
966
 
967
967
  test("Sparse", () => {
968
968
  let sequential = true;
969
969
 
970
- let sequenceCount = 0;
970
+ let index = 0;
971
971
 
972
- Iterator.from(creator.create(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, new Sequence(0, referenceCount), Exclusion.None, 123456n))).forEach((identificationKey, index) => {
972
+ for (const identificationKey of creator.create(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, new Sequence(0, referenceCount), Exclusion.None, 123456n))) {
973
973
  expect(() => {
974
974
  creator.validate(identificationKey);
975
975
  }).not.toThrow(RangeError);
@@ -984,11 +984,11 @@ function testNonNumericIdentificationKeyCreator(creator: NonNumericIdentificatio
984
984
 
985
985
  expect(identificationKey).toBe(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, index, Exclusion.None, 123456n, reference => creator.create(reference)));
986
986
 
987
- sequenceCount++;
988
- });
987
+ index++;
988
+ }
989
989
 
990
990
  expect(sequential).toBe(false);
991
- expect(sequenceCount).toBe(referenceCount);
991
+ expect(index).toBe(referenceCount);
992
992
  });
993
993
 
994
994
  test("Position offset", () => {
package/typedoc.json CHANGED
@@ -4,8 +4,6 @@
4
4
  "@aidc-toolkit/dev/typedoc.json"
5
5
  ],
6
6
  "name": "GS1",
7
- "entryPoints": [
8
- "src/index.ts"
9
- ],
7
+ "tsconfig": "node_modules/@aidc-toolkit/dev/tsconfig-build-dev.json",
10
8
  "gitRevision": "main"
11
9
  }