@aidc-toolkit/gs1 0.9.7-beta → 0.9.8-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 +2312 -128
- package/dist/index.d.cts +646 -6
- package/dist/index.d.ts +646 -6
- package/dist/index.js +2286 -105
- package/package.json +5 -4
- package/src/check.ts +24 -9
- package/src/idkey.ts +50 -99
- package/src/index.ts +2 -2
- package/src/locale/en/{locale_strings.ts → locale-strings.ts} +2 -0
- package/src/locale/fr/{locale_strings.ts → locale-strings.ts} +2 -0
- package/src/locale/i18n.ts +39 -6
- package/src/locale/i18next.d.ts +5 -3
- package/test/check.test.ts +9 -8
- package/test/idkey.test.ts +5 -4
- /package/src/{character_set.ts → character-set.ts} +0 -0
package/test/idkey.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I18NEnvironment
|
|
1
|
+
import { I18NEnvironment } from "@aidc-toolkit/core";
|
|
2
2
|
import { CharacterSetCreator, Exclusion, NUMERIC_CREATOR, Sequencer } from "@aidc-toolkit/utility";
|
|
3
3
|
import { describe, expect, test } from "vitest";
|
|
4
4
|
import {
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
type GTINValidator,
|
|
26
26
|
hasValidCheckCharacterPair,
|
|
27
27
|
hasValidCheckDigit,
|
|
28
|
+
i18nGS1Init,
|
|
28
29
|
IdentificationKeyType,
|
|
29
30
|
type IdentificationKeyValidator,
|
|
30
31
|
LeaderType,
|
|
@@ -41,7 +42,7 @@ import {
|
|
|
41
42
|
SSCC_VALIDATOR
|
|
42
43
|
} from "../src/index.js";
|
|
43
44
|
|
|
44
|
-
await
|
|
45
|
+
await i18nGS1Init(I18NEnvironment.CLI);
|
|
45
46
|
|
|
46
47
|
function creatorFor(characterSet: ContentCharacterSet): CharacterSetCreator {
|
|
47
48
|
let creator: CharacterSetCreator;
|
|
@@ -106,7 +107,7 @@ function validateGTINValidator(validator: GTINValidator, isCreator: boolean, gti
|
|
|
106
107
|
expect(validator.gtinType).toBe(gtinType);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
function validateNonGTINNumericIdentificationKeyValidator
|
|
110
|
+
function validateNonGTINNumericIdentificationKeyValidator(validator: NonGTINNumericIdentificationKeyValidator, isCreator: boolean, identificationKeyType: IdentificationKeyType, length: number, leaderType: LeaderType): void {
|
|
110
111
|
validateNumericIdentificationKeyValidator(validator, isCreator, identificationKeyType, PrefixType.GS1CompanyPrefix, length, leaderType);
|
|
111
112
|
}
|
|
112
113
|
|
|
@@ -927,7 +928,7 @@ function testSerializableNumericIdentificationKeyCreator(creator: SerializableNu
|
|
|
927
928
|
|
|
928
929
|
const TEST_REFERENCE_LENGTH = 2;
|
|
929
930
|
|
|
930
|
-
function testNonNumericIdentificationKeyCreator
|
|
931
|
+
function testNonNumericIdentificationKeyCreator(creator: NonNumericIdentificationKeyCreator): void {
|
|
931
932
|
describe(creator.identificationKeyType, () => {
|
|
932
933
|
const prefix = creator.prefix;
|
|
933
934
|
const prefixLength = prefix.length;
|
|
File without changes
|