@aidc-toolkit/gs1 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/dist/index.cjs +4813 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1949 -0
- package/dist/index.d.ts +1949 -36
- package/dist/index.js +4727 -19
- package/dist/index.js.map +1 -1
- package/package.json +8 -12
- package/src/abstract-identifier-creator.ts +97 -0
- package/src/abstract-identifier-validator.ts +140 -0
- package/{dist/numeric-identifier-creator.js → src/abstract-numeric-identifier-creator.ts} +61 -28
- package/src/abstract-numeric-identifier-validator.ts +69 -0
- package/src/character-set.ts +24 -9
- package/src/check.ts +9 -9
- package/src/content-character-set.ts +29 -0
- package/src/creators.ts +113 -0
- package/src/descriptors.ts +332 -0
- package/src/gtin-creator.ts +9 -8
- package/src/gtin-descriptor.ts +18 -0
- package/src/gtin-type.ts +50 -0
- package/src/gtin-validator.ts +40 -64
- package/src/identifier-creator.ts +11 -75
- package/src/identifier-descriptor.ts +30 -0
- package/src/identifier-type.ts +6 -1
- package/src/identifier-validator.ts +12 -188
- package/src/index.ts +43 -19
- package/src/locale/en/locale-resources.ts +0 -1
- package/src/locale/fr/locale-resources.ts +0 -1
- package/src/locale/i18n.ts +3 -5
- package/src/locale/i18next.d.ts +1 -1
- package/src/non-gtin-numeric-identifier-creator.ts +6 -12
- package/src/non-gtin-numeric-identifier-descriptor.ts +24 -0
- package/src/non-gtin-numeric-identifier-type.ts +7 -0
- package/src/non-gtin-numeric-identifier-validator.ts +8 -42
- package/src/non-numeric-identifier-creator.ts +8 -18
- package/src/non-numeric-identifier-descriptor.ts +29 -0
- package/src/non-numeric-identifier-type.ts +7 -0
- package/src/non-numeric-identifier-validator.ts +17 -55
- package/src/numeric-identifier-creator.ts +20 -163
- package/src/numeric-identifier-descriptor.ts +23 -0
- package/src/numeric-identifier-type.ts +44 -0
- package/src/numeric-identifier-validator.ts +13 -116
- package/src/prefix-manager.ts +94 -152
- package/src/prefix-provider.ts +3 -3
- package/src/prefix-type.ts +6 -1
- package/src/prefix-validator.ts +143 -81
- package/src/serializable-numeric-identifier-creator.ts +5 -15
- package/src/serializable-numeric-identifier-descriptor.ts +29 -0
- package/src/serializable-numeric-identifier-type.ts +9 -0
- package/src/serializable-numeric-identifier-validator.ts +18 -46
- package/src/validators.ts +203 -0
- package/test/creator.test.ts +4 -6
- package/test/gtin-creator.ts +6 -2
- package/test/gtin-validator.test.ts +6 -9
- package/test/identifier-creator.ts +5 -4
- package/test/identifier-validator.ts +2 -2
- package/test/non-gtin-numeric-identifier-creator.ts +9 -93
- package/test/non-gtin-numeric-identifier-validator.ts +2 -2
- package/test/non-numeric-identifier-creator.ts +93 -0
- package/test/non-numeric-identifier-validator.ts +2 -2
- package/test/numeric-identifier-creator.ts +11 -5
- package/test/numeric-identifier-validator.ts +4 -8
- package/test/prefix-manager.test.ts +1 -1
- package/test/serializable-numeric-identifier-creator.ts +11 -3
- package/test/serializable-numeric-identifier-validator.ts +2 -2
- package/test/validator.test.ts +63 -39
- package/tsup.config.ts +3 -0
- package/typedoc.json +1 -3
- package/dist/character-set.d.ts +0 -22
- package/dist/character-set.d.ts.map +0 -1
- package/dist/character-set.js +0 -36
- package/dist/character-set.js.map +0 -1
- package/dist/check.d.ts +0 -81
- package/dist/check.d.ts.map +0 -1
- package/dist/check.js +0 -218
- package/dist/check.js.map +0 -1
- package/dist/gtin-creator.d.ts +0 -68
- package/dist/gtin-creator.d.ts.map +0 -1
- package/dist/gtin-creator.js +0 -158
- package/dist/gtin-creator.js.map +0 -1
- package/dist/gtin-validator.d.ts +0 -202
- package/dist/gtin-validator.d.ts.map +0 -1
- package/dist/gtin-validator.js +0 -470
- package/dist/gtin-validator.js.map +0 -1
- package/dist/identifier-creator.d.ts +0 -72
- package/dist/identifier-creator.d.ts.map +0 -1
- package/dist/identifier-creator.js +0 -50
- package/dist/identifier-creator.js.map +0 -1
- package/dist/identifier-type.d.ts +0 -58
- package/dist/identifier-type.d.ts.map +0 -1
- package/dist/identifier-type.js +0 -54
- package/dist/identifier-type.js.map +0 -1
- package/dist/identifier-validator.d.ts +0 -174
- package/dist/identifier-validator.d.ts.map +0 -1
- package/dist/identifier-validator.js +0 -145
- package/dist/identifier-validator.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.d.ts +0 -43
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -42
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -43
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -42
- 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 -37
- package/dist/locale/i18n.js.map +0 -1
- package/dist/non-gtin-numeric-identifier-creator.d.ts +0 -30
- package/dist/non-gtin-numeric-identifier-creator.d.ts.map +0 -1
- package/dist/non-gtin-numeric-identifier-creator.js +0 -30
- package/dist/non-gtin-numeric-identifier-creator.js.map +0 -1
- package/dist/non-gtin-numeric-identifier-validator.d.ts +0 -41
- package/dist/non-gtin-numeric-identifier-validator.d.ts.map +0 -1
- package/dist/non-gtin-numeric-identifier-validator.js +0 -40
- package/dist/non-gtin-numeric-identifier-validator.js.map +0 -1
- package/dist/non-numeric-identifier-creator.d.ts +0 -55
- package/dist/non-numeric-identifier-creator.d.ts.map +0 -1
- package/dist/non-numeric-identifier-creator.js +0 -93
- package/dist/non-numeric-identifier-creator.js.map +0 -1
- package/dist/non-numeric-identifier-validator.d.ts +0 -78
- package/dist/non-numeric-identifier-validator.d.ts.map +0 -1
- package/dist/non-numeric-identifier-validator.js +0 -95
- package/dist/non-numeric-identifier-validator.js.map +0 -1
- package/dist/numeric-identifier-creator.d.ts +0 -121
- package/dist/numeric-identifier-creator.d.ts.map +0 -1
- package/dist/numeric-identifier-creator.js.map +0 -1
- package/dist/numeric-identifier-validator.d.ts +0 -76
- package/dist/numeric-identifier-validator.d.ts.map +0 -1
- package/dist/numeric-identifier-validator.js +0 -84
- package/dist/numeric-identifier-validator.js.map +0 -1
- package/dist/prefix-manager.d.ts +0 -224
- package/dist/prefix-manager.d.ts.map +0 -1
- package/dist/prefix-manager.js +0 -369
- package/dist/prefix-manager.js.map +0 -1
- package/dist/prefix-provider.d.ts +0 -27
- package/dist/prefix-provider.d.ts.map +0 -1
- package/dist/prefix-provider.js +0 -2
- package/dist/prefix-provider.js.map +0 -1
- package/dist/prefix-type.d.ts +0 -22
- package/dist/prefix-type.d.ts.map +0 -1
- package/dist/prefix-type.js +0 -18
- package/dist/prefix-type.js.map +0 -1
- package/dist/prefix-validator.d.ts +0 -58
- package/dist/prefix-validator.d.ts.map +0 -1
- package/dist/prefix-validator.js +0 -154
- package/dist/prefix-validator.js.map +0 -1
- package/dist/serializable-numeric-identifier-creator.d.ts +0 -86
- package/dist/serializable-numeric-identifier-creator.d.ts.map +0 -1
- package/dist/serializable-numeric-identifier-creator.js +0 -116
- package/dist/serializable-numeric-identifier-creator.js.map +0 -1
- package/dist/serializable-numeric-identifier-validator.d.ts +0 -79
- package/dist/serializable-numeric-identifier-validator.d.ts.map +0 -1
- package/dist/serializable-numeric-identifier-validator.js +0 -99
- package/dist/serializable-numeric-identifier-validator.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, test } from "vitest";
|
|
2
2
|
import {
|
|
3
|
+
type GTINBaseType,
|
|
3
4
|
GTINLevels,
|
|
4
|
-
type GTINType,
|
|
5
5
|
GTINTypes,
|
|
6
6
|
GTINValidator,
|
|
7
7
|
IdentifierTypes,
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
type PrefixType,
|
|
10
10
|
PrefixTypes
|
|
11
11
|
} from "../src";
|
|
12
|
-
import { validateNumericIdentifierValidator } from "./numeric-identifier-validator
|
|
12
|
+
import { validateNumericIdentifierValidator } from "./numeric-identifier-validator";
|
|
13
13
|
|
|
14
|
-
export function validateGTINValidator(validator: GTINValidator, isCreator: boolean,
|
|
14
|
+
export function validateGTINValidator(validator: GTINValidator, isCreator: boolean, gtinBaseType: GTINBaseType): void {
|
|
15
15
|
let prefixType: PrefixType;
|
|
16
16
|
|
|
17
|
-
switch (
|
|
17
|
+
switch (gtinBaseType) {
|
|
18
18
|
case GTINTypes.GTIN13:
|
|
19
19
|
prefixType = PrefixTypes.GS1CompanyPrefix;
|
|
20
20
|
break;
|
|
@@ -26,14 +26,11 @@ export function validateGTINValidator(validator: GTINValidator, isCreator: boole
|
|
|
26
26
|
case GTINTypes.GTIN8:
|
|
27
27
|
prefixType = PrefixTypes.GS18Prefix;
|
|
28
28
|
break;
|
|
29
|
-
|
|
30
|
-
default:
|
|
31
|
-
throw new Error("Not supported");
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
validateNumericIdentifierValidator(validator,
|
|
31
|
+
validateNumericIdentifierValidator(validator, IdentifierTypes.GTIN, prefixType, gtinBaseType, LeaderTypes.IndicatorDigit);
|
|
35
32
|
|
|
36
|
-
expect(validator.gtinType).toBe(
|
|
33
|
+
expect(validator.gtinType).toBe(gtinBaseType);
|
|
37
34
|
}
|
|
38
35
|
|
|
39
36
|
describe("GTIN validation and normalization", () => {
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
type PrefixManager,
|
|
9
9
|
PrefixTypes
|
|
10
10
|
} from "../src";
|
|
11
|
-
import { validateGTINValidator } from "./gtin-validator.test
|
|
12
|
-
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator
|
|
13
|
-
import { validateNonNumericIdentifierValidator } from "./non-numeric-identifier-validator
|
|
14
|
-
import { validateSerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator
|
|
11
|
+
import { validateGTINValidator } from "./gtin-validator.test";
|
|
12
|
+
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator";
|
|
13
|
+
import { validateNonNumericIdentifierValidator } from "./non-numeric-identifier-validator";
|
|
14
|
+
import { validateSerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator";
|
|
15
15
|
|
|
16
16
|
export function validateIdentifierCreators(prefixManager: PrefixManager): void {
|
|
17
17
|
let gtinType: GTINType;
|
|
@@ -33,6 +33,7 @@ export function validateIdentifierCreators(prefixManager: PrefixManager): void {
|
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
// Validate creator caching.
|
|
36
37
|
expect(prefixManager.gtinCreator).toBe(prefixManager.gtinCreator);
|
|
37
38
|
|
|
38
39
|
validateGTINValidator(prefixManager.gtinCreator, true, gtinType);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { expect } from "vitest";
|
|
2
|
-
import type { IdentifierType,
|
|
2
|
+
import type { IdentifierType, IdentifierTypeValidator, PrefixType } from "../src";
|
|
3
3
|
|
|
4
|
-
export function validateIdentifierValidator(creator:
|
|
4
|
+
export function validateIdentifierValidator<TIdentifierType extends IdentifierType>(creator: IdentifierTypeValidator<TIdentifierType>, identifierType: IdentifierType, prefixType: PrefixType, length: number): void {
|
|
5
5
|
expect(creator.identifierType).toBe(identifierType);
|
|
6
6
|
expect(creator.prefixType).toBe(prefixType);
|
|
7
7
|
expect(creator.length).toBe(length);
|
|
@@ -1,98 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
type NonGTINNumericIdentifierCreator,
|
|
6
|
-
type NonNumericIdentifierCreator
|
|
7
|
-
} from "../src";
|
|
8
|
-
import { testNumericIdentifierCreator } from "./numeric-identifier-creator.js";
|
|
1
|
+
import { expect, test } from "vitest";
|
|
2
|
+
import { isNonGTINNumericIdentifierCreator, type NonGTINNumericIdentifierCreator } from "../src";
|
|
3
|
+
import { testIdentifierCreatorCallback } from "./identifier-creator";
|
|
4
|
+
import { testNumericIdentifierCreator } from "./numeric-identifier-creator";
|
|
9
5
|
|
|
10
6
|
export function testNonGTINNumericIdentifierCreator(creator: NonGTINNumericIdentifierCreator, preTestCallback?: () => void, postTestCallback?: () => void): void {
|
|
11
|
-
testNumericIdentifierCreator(creator,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const TEST_REFERENCE_LENGTH = 2;
|
|
15
|
-
|
|
16
|
-
export function testNonNumericIdentifierCreator(creator: NonNumericIdentifierCreator): void {
|
|
17
|
-
describe(creator.identifierType, () => {
|
|
18
|
-
const prefix = creator.prefix;
|
|
19
|
-
const prefixLength = prefix.length;
|
|
20
|
-
const referenceLength = creator.length - prefixLength - 2 * Number(creator.requiresCheckCharacterPair);
|
|
21
|
-
const referenceCount = creator.referenceCreator.characterSetSize ** TEST_REFERENCE_LENGTH;
|
|
22
|
-
const referenceSubstringStart = prefixLength;
|
|
23
|
-
const referenceSubstringEnd = prefixLength + TEST_REFERENCE_LENGTH;
|
|
24
|
-
|
|
25
|
-
test("Straight", () => {
|
|
26
|
-
expect(creator.referenceLength).toBe(referenceLength);
|
|
27
|
-
|
|
28
|
-
let index = 0;
|
|
29
|
-
|
|
30
|
-
for (const identifier of creator.create(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, new Sequence(0, referenceCount)))) {
|
|
31
|
-
expect(() => {
|
|
32
|
-
creator.validate(identifier);
|
|
33
|
-
}).not.toThrow(RangeError);
|
|
34
|
-
|
|
35
|
-
expect(Number(creator.referenceCreator.valueFor(identifier.substring(referenceSubstringStart, referenceSubstringEnd)))).toBe(index);
|
|
36
|
-
|
|
37
|
-
expect(identifier.length).toBeLessThanOrEqual(creator.length);
|
|
38
|
-
expect(identifier.substring(0, prefixLength)).toBe(prefix);
|
|
39
|
-
expect(!creator.requiresCheckCharacterPair || hasValidCheckCharacterPair(identifier)).toBe(true);
|
|
40
|
-
|
|
41
|
-
expect(identifier).toBe(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, index, Exclusions.None, undefined, reference => creator.create(reference)));
|
|
42
|
-
|
|
43
|
-
index++;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
expect(index).toBe(referenceCount);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
test("Sparse", () => {
|
|
50
|
-
let sequential = true;
|
|
51
|
-
|
|
52
|
-
let index = 0;
|
|
53
|
-
|
|
54
|
-
for (const identifier of creator.create(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, new Sequence(0, referenceCount), Exclusions.None, 123456n))) {
|
|
55
|
-
expect(() => {
|
|
56
|
-
creator.validate(identifier);
|
|
57
|
-
}).not.toThrow(RangeError);
|
|
58
|
-
|
|
59
|
-
expect(Number(creator.referenceCreator.valueFor(identifier.substring(referenceSubstringStart, referenceSubstringEnd), Exclusions.None, 123456n))).toBe(index);
|
|
60
|
-
|
|
61
|
-
sequential &&= Number(creator.referenceCreator.valueFor(identifier.substring(referenceSubstringStart, referenceSubstringEnd))) === index;
|
|
62
|
-
|
|
63
|
-
expect(identifier.length).toBeLessThanOrEqual(creator.length);
|
|
64
|
-
expect(identifier.substring(0, prefixLength)).toBe(prefix);
|
|
65
|
-
expect(!creator.requiresCheckCharacterPair || hasValidCheckCharacterPair(identifier)).toBe(true);
|
|
66
|
-
|
|
67
|
-
expect(identifier).toBe(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, index, Exclusions.None, 123456n, reference => creator.create(reference)));
|
|
68
|
-
|
|
69
|
-
index++;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
expect(sequential).toBe(false);
|
|
73
|
-
expect(index).toBe(referenceCount);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test("Position offset", () => {
|
|
77
|
-
expect(() => {
|
|
78
|
-
creator.validate(creator.create("ABC123"), {
|
|
79
|
-
positionOffset: 4
|
|
80
|
-
});
|
|
81
|
-
}).not.toThrow(RangeError);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test("Not all numeric", () => {
|
|
85
|
-
expect(() => {
|
|
86
|
-
creator.validate(creator.create("01234"), {
|
|
87
|
-
exclusion: Exclusions.AllNumeric
|
|
88
|
-
});
|
|
89
|
-
}).toThrow("Reference can't be all-numeric");
|
|
7
|
+
testNumericIdentifierCreator(creator, () => {
|
|
8
|
+
testIdentifierCreatorCallback(preTestCallback);
|
|
90
9
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
exclusion: Exclusions.AllNumeric
|
|
94
|
-
});
|
|
95
|
-
}).not.toThrow(RangeError);
|
|
10
|
+
test("Mapping", () => {
|
|
11
|
+
expect(isNonGTINNumericIdentifierCreator(creator)).toBe(true);
|
|
96
12
|
});
|
|
97
|
-
});
|
|
13
|
+
}, postTestCallback);
|
|
98
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IdentifierType, type LeaderType, type NonGTINNumericIdentifierValidator, PrefixTypes } from "../src";
|
|
2
|
-
import { validateNumericIdentifierValidator } from "./numeric-identifier-validator
|
|
2
|
+
import { validateNumericIdentifierValidator } from "./numeric-identifier-validator";
|
|
3
3
|
|
|
4
4
|
export function validateNonGTINNumericIdentifierValidator(validator: NonGTINNumericIdentifierValidator, isCreator: boolean, identifierType: IdentifierType, length: number, leaderType: LeaderType): void {
|
|
5
|
-
validateNumericIdentifierValidator(validator,
|
|
5
|
+
validateNumericIdentifierValidator(validator, identifierType, PrefixTypes.GS1CompanyPrefix, length, leaderType);
|
|
6
6
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Exclusions, Sequence } from "@aidc-toolkit/utility";
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
import { hasValidCheckCharacterPair, isNonNumericIdentifierCreator, type NonNumericIdentifierCreator } from "../src";
|
|
4
|
+
|
|
5
|
+
const TEST_REFERENCE_LENGTH = 2;
|
|
6
|
+
|
|
7
|
+
export function testNonNumericIdentifierCreator(creator: NonNumericIdentifierCreator): void {
|
|
8
|
+
describe(creator.identifierType, () => {
|
|
9
|
+
const prefix = creator.prefix;
|
|
10
|
+
const prefixLength = prefix.length;
|
|
11
|
+
const referenceLength = creator.length - prefixLength - 2 * Number(creator.requiresCheckCharacterPair);
|
|
12
|
+
const referenceCount = creator.referenceCreator.characterSetSize ** TEST_REFERENCE_LENGTH;
|
|
13
|
+
const referenceSubstringStart = prefixLength;
|
|
14
|
+
const referenceSubstringEnd = prefixLength + TEST_REFERENCE_LENGTH;
|
|
15
|
+
|
|
16
|
+
test("Mapping", () => {
|
|
17
|
+
expect(isNonNumericIdentifierCreator(creator)).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test("Straight", () => {
|
|
21
|
+
expect(creator.referenceLength).toBe(referenceLength);
|
|
22
|
+
|
|
23
|
+
let index = 0;
|
|
24
|
+
|
|
25
|
+
for (const identifier of creator.create(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, new Sequence(0, referenceCount)))) {
|
|
26
|
+
expect(() => {
|
|
27
|
+
creator.validate(identifier);
|
|
28
|
+
}).not.toThrow(RangeError);
|
|
29
|
+
|
|
30
|
+
expect(Number(creator.referenceCreator.valueFor(identifier.substring(referenceSubstringStart, referenceSubstringEnd)))).toBe(index);
|
|
31
|
+
|
|
32
|
+
expect(identifier.length).toBeLessThanOrEqual(creator.length);
|
|
33
|
+
expect(identifier.substring(0, prefixLength)).toBe(prefix);
|
|
34
|
+
expect(!creator.requiresCheckCharacterPair || hasValidCheckCharacterPair(identifier)).toBe(true);
|
|
35
|
+
|
|
36
|
+
expect(identifier).toBe(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, index, Exclusions.None, undefined, reference => creator.create(reference)));
|
|
37
|
+
|
|
38
|
+
index++;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
expect(index).toBe(referenceCount);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test("Sparse", () => {
|
|
45
|
+
let sequential = true;
|
|
46
|
+
|
|
47
|
+
let index = 0;
|
|
48
|
+
|
|
49
|
+
for (const identifier of creator.create(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, new Sequence(0, referenceCount), Exclusions.None, 123456n))) {
|
|
50
|
+
expect(() => {
|
|
51
|
+
creator.validate(identifier);
|
|
52
|
+
}).not.toThrow(RangeError);
|
|
53
|
+
|
|
54
|
+
expect(Number(creator.referenceCreator.valueFor(identifier.substring(referenceSubstringStart, referenceSubstringEnd), Exclusions.None, 123456n))).toBe(index);
|
|
55
|
+
|
|
56
|
+
sequential &&= Number(creator.referenceCreator.valueFor(identifier.substring(referenceSubstringStart, referenceSubstringEnd))) === index;
|
|
57
|
+
|
|
58
|
+
expect(identifier.length).toBeLessThanOrEqual(creator.length);
|
|
59
|
+
expect(identifier.substring(0, prefixLength)).toBe(prefix);
|
|
60
|
+
expect(!creator.requiresCheckCharacterPair || hasValidCheckCharacterPair(identifier)).toBe(true);
|
|
61
|
+
|
|
62
|
+
expect(identifier).toBe(creator.referenceCreator.create(TEST_REFERENCE_LENGTH, index, Exclusions.None, 123456n, reference => creator.create(reference)));
|
|
63
|
+
|
|
64
|
+
index++;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
expect(sequential).toBe(false);
|
|
68
|
+
expect(index).toBe(referenceCount);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test("Position offset", () => {
|
|
72
|
+
expect(() => {
|
|
73
|
+
creator.validate(creator.create("ABC123"), {
|
|
74
|
+
positionOffset: 4
|
|
75
|
+
});
|
|
76
|
+
}).not.toThrow(RangeError);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test("Not all numeric", () => {
|
|
80
|
+
expect(() => {
|
|
81
|
+
creator.validate(creator.create("01234"), {
|
|
82
|
+
exclusion: Exclusions.AllNumeric
|
|
83
|
+
});
|
|
84
|
+
}).toThrow("Reference can't be all-numeric");
|
|
85
|
+
|
|
86
|
+
expect(() => {
|
|
87
|
+
creator.validate(creator.create("O1234"), {
|
|
88
|
+
exclusion: Exclusions.AllNumeric
|
|
89
|
+
});
|
|
90
|
+
}).not.toThrow(RangeError);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
type NonNumericIdentifierValidator,
|
|
7
7
|
PrefixTypes
|
|
8
8
|
} from "../src";
|
|
9
|
-
import { validateIdentifierValidator } from "./identifier-validator
|
|
10
|
-
import { creatorFor } from "./utility
|
|
9
|
+
import { validateIdentifierValidator } from "./identifier-validator";
|
|
10
|
+
import { creatorFor } from "./utility";
|
|
11
11
|
|
|
12
12
|
export function validateNonNumericIdentifierValidator(validator: NonNumericIdentifierValidator, isCreator: boolean, identifierType: IdentifierType, length: number, referenceCharacterSet: ContentCharacterSet, requiresCheckCharacterPair: boolean): void {
|
|
13
13
|
validateIdentifierValidator(validator, identifierType, PrefixTypes.GS1CompanyPrefix, length);
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { CharacterSetCreator, Sequence } from "@aidc-toolkit/utility";
|
|
2
2
|
import { describe, expect, test } from "vitest";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import {
|
|
4
|
+
hasValidCheckDigit,
|
|
5
|
+
isGTINCreator,
|
|
6
|
+
LeaderTypes,
|
|
7
|
+
type NumericIdentifierCreator,
|
|
8
|
+
type NumericIdentifierDescriptor
|
|
9
|
+
} from "../src";
|
|
10
|
+
import { testIdentifierCreatorCallback } from "./identifier-creator";
|
|
11
|
+
|
|
12
|
+
export function testNumericIdentifierCreator<TNumericIdentifierDescriptor extends NumericIdentifierDescriptor>(creator: NumericIdentifierCreator<TNumericIdentifierDescriptor>, preTestCallback?: () => void, postTestCallback?: () => void): void {
|
|
13
|
+
describe(isGTINCreator(creator) ? `${creator.identifierType}-${creator.length}` : creator.identifierType as string, () => {
|
|
8
14
|
testIdentifierCreatorCallback(preTestCallback);
|
|
9
15
|
|
|
10
16
|
const prefix = creator.prefix;
|
|
@@ -3,21 +3,17 @@ import { expect } from "vitest";
|
|
|
3
3
|
import {
|
|
4
4
|
ContentCharacterSets,
|
|
5
5
|
type IdentifierType,
|
|
6
|
+
type IdentifierTypeValidator,
|
|
6
7
|
type LeaderType,
|
|
7
|
-
type
|
|
8
|
-
type NumericIdentifierValidator,
|
|
8
|
+
type NumericIdentifierType,
|
|
9
9
|
type PrefixType
|
|
10
10
|
} from "../src";
|
|
11
|
-
import { validateIdentifierValidator } from "./identifier-validator
|
|
11
|
+
import { validateIdentifierValidator } from "./identifier-validator";
|
|
12
12
|
|
|
13
|
-
export function validateNumericIdentifierValidator(validator:
|
|
13
|
+
export function validateNumericIdentifierValidator<TNumericIdentifierType extends NumericIdentifierType>(validator: IdentifierTypeValidator<TNumericIdentifierType>, identifierType: IdentifierType, prefixType: PrefixType, length: number, leaderType: LeaderType): void {
|
|
14
14
|
validateIdentifierValidator(validator, identifierType, prefixType, length);
|
|
15
15
|
|
|
16
16
|
expect(validator.leaderType).toBe(leaderType);
|
|
17
17
|
expect(validator.referenceCharacterSet).toBe(ContentCharacterSets.Numeric);
|
|
18
18
|
expect(validator.referenceCreator).toBe(NUMERIC_CREATOR);
|
|
19
|
-
|
|
20
|
-
if (isCreator) {
|
|
21
|
-
expect((validator as NumericIdentifierCreator).referenceCreator).toBe(NUMERIC_CREATOR);
|
|
22
|
-
}
|
|
23
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "vitest";
|
|
2
2
|
import { PrefixManager, PrefixTypes } from "../src";
|
|
3
|
-
import { validateIdentifierCreators } from "./identifier-creator
|
|
3
|
+
import { validateIdentifierCreators } from "./identifier-creator";
|
|
4
4
|
|
|
5
5
|
describe("Prefix manager", () => {
|
|
6
6
|
let prefixManager: PrefixManager;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { expect, test } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
ContentCharacterSets,
|
|
4
|
+
isSerializableNumericIdentifierCreator,
|
|
5
|
+
type SerializableNumericIdentifierCreator
|
|
6
|
+
} from "../src";
|
|
7
|
+
import { testNonGTINNumericIdentifierCreator } from "./non-gtin-numeric-identifier-creator";
|
|
4
8
|
|
|
5
9
|
export function testSerializableNumericIdentifierCreator(creator: SerializableNumericIdentifierCreator): void {
|
|
6
|
-
testNonGTINNumericIdentifierCreator(creator,
|
|
10
|
+
testNonGTINNumericIdentifierCreator(creator, () => {
|
|
11
|
+
test("Mapping", () => {
|
|
12
|
+
expect(isSerializableNumericIdentifierCreator(creator)).toBe(true);
|
|
13
|
+
});
|
|
14
|
+
}, () => {
|
|
7
15
|
test("Serialization", () => {
|
|
8
16
|
const identifier = creator.create(0, true);
|
|
9
17
|
const serial = "12345678";
|
|
@@ -6,8 +6,8 @@ import type {
|
|
|
6
6
|
SerializableNumericIdentifierCreator,
|
|
7
7
|
SerializableNumericIdentifierValidator
|
|
8
8
|
} from "../src";
|
|
9
|
-
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator
|
|
10
|
-
import { creatorFor } from "./utility
|
|
9
|
+
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator";
|
|
10
|
+
import { creatorFor } from "./utility";
|
|
11
11
|
|
|
12
12
|
export function validateSerializableNumericIdentifierValidator(validator: SerializableNumericIdentifierValidator, isCreator: boolean, identifierType: IdentifierType, length: number, leaderType: LeaderType, serialLength: number, serialCharacterSet: ContentCharacterSet): void {
|
|
13
13
|
validateNonGTINNumericIdentifierValidator(validator, isCreator, identifierType, length, leaderType);
|
package/test/validator.test.ts
CHANGED
|
@@ -1,52 +1,76 @@
|
|
|
1
1
|
import { describe, expect, test } from "vitest";
|
|
2
2
|
import {
|
|
3
3
|
ContentCharacterSets,
|
|
4
|
-
|
|
5
|
-
GCN_VALIDATOR,
|
|
6
|
-
GDTI_VALIDATOR,
|
|
7
|
-
GIAI_VALIDATOR,
|
|
8
|
-
GINC_VALIDATOR,
|
|
9
|
-
GLN_VALIDATOR,
|
|
10
|
-
GMN_VALIDATOR,
|
|
11
|
-
GRAI_VALIDATOR,
|
|
12
|
-
GSIN_VALIDATOR,
|
|
13
|
-
GSRN_VALIDATOR,
|
|
14
|
-
GTIN12_VALIDATOR,
|
|
15
|
-
GTIN13_VALIDATOR,
|
|
16
|
-
GTIN8_VALIDATOR,
|
|
17
|
-
GTIN_VALIDATORS,
|
|
4
|
+
type GTINBaseType,
|
|
18
5
|
GTINTypes,
|
|
6
|
+
type GTINValidator,
|
|
7
|
+
type IdentifierType,
|
|
19
8
|
IdentifierTypes,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
type IdentifierValidator,
|
|
10
|
+
IdentifierValidators,
|
|
11
|
+
isGTINValidator,
|
|
12
|
+
isGTINValidators,
|
|
13
|
+
isNonGTINNumericIdentifierValidator,
|
|
14
|
+
isNonNumericIdentifierValidator,
|
|
15
|
+
isNumericIdentifierValidator,
|
|
16
|
+
isSerializableNumericIdentifierValidator,
|
|
17
|
+
LeaderTypes
|
|
23
18
|
} from "../src";
|
|
24
|
-
import { validateGTINValidator } from "./gtin-validator.test
|
|
25
|
-
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator
|
|
26
|
-
import { validateNonNumericIdentifierValidator } from "./non-numeric-identifier-validator
|
|
27
|
-
import { validateSerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator
|
|
19
|
+
import { validateGTINValidator } from "./gtin-validator.test";
|
|
20
|
+
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator";
|
|
21
|
+
import { validateNonNumericIdentifierValidator } from "./non-numeric-identifier-validator";
|
|
22
|
+
import { validateSerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator";
|
|
28
23
|
|
|
29
24
|
describe("Validators", () => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
function validateMapping(identifierType: IdentifierType, expectedIdentifierValidatorsOrValidator: Readonly<Record<GTINBaseType, GTINValidator>> | IdentifierValidator, ...isIdentifierValidatorTypes: Array<(validator: IdentifierValidator) => boolean>): void {
|
|
26
|
+
test(identifierType, () => {
|
|
27
|
+
const validatorsOrValidator = IdentifierValidators[identifierType];
|
|
28
|
+
|
|
29
|
+
expect(validatorsOrValidator).toBe(expectedIdentifierValidatorsOrValidator);
|
|
30
|
+
|
|
31
|
+
if (isGTINValidators(validatorsOrValidator)) {
|
|
32
|
+
for (const validator of Object.values(validatorsOrValidator)) {
|
|
33
|
+
for (const isIdentifierValidatorType of isIdentifierValidatorTypes) {
|
|
34
|
+
expect(isIdentifierValidatorType(validator)).toBe(true);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
for (const isIdentifierValidatorType of isIdentifierValidatorTypes) {
|
|
39
|
+
expect(isIdentifierValidatorType(validatorsOrValidator)).toBe(true);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
describe("Mapping", () => {
|
|
46
|
+
validateMapping(IdentifierTypes.GTIN, IdentifierValidators.GTIN, isNumericIdentifierValidator, isGTINValidator);
|
|
47
|
+
validateMapping(IdentifierTypes.GLN, IdentifierValidators.GLN, isNumericIdentifierValidator, isNonGTINNumericIdentifierValidator);
|
|
48
|
+
validateMapping(IdentifierTypes.SSCC, IdentifierValidators.SSCC, isNumericIdentifierValidator, isNonGTINNumericIdentifierValidator);
|
|
49
|
+
validateMapping(IdentifierTypes.GRAI, IdentifierValidators.GRAI, isNumericIdentifierValidator, isNonGTINNumericIdentifierValidator, isSerializableNumericIdentifierValidator);
|
|
50
|
+
validateMapping(IdentifierTypes.GIAI, IdentifierValidators.GIAI, isNonNumericIdentifierValidator);
|
|
51
|
+
validateMapping(IdentifierTypes.GSRN, IdentifierValidators.GSRN, isNumericIdentifierValidator, isNonGTINNumericIdentifierValidator);
|
|
52
|
+
validateMapping(IdentifierTypes.GDTI, IdentifierValidators.GDTI, isNumericIdentifierValidator, isNonGTINNumericIdentifierValidator, isSerializableNumericIdentifierValidator);
|
|
53
|
+
validateMapping(IdentifierTypes.GINC, IdentifierValidators.GINC, isNonNumericIdentifierValidator);
|
|
54
|
+
validateMapping(IdentifierTypes.GSIN, IdentifierValidators.GSIN, isNumericIdentifierValidator, isNonGTINNumericIdentifierValidator);
|
|
55
|
+
validateMapping(IdentifierTypes.GCN, IdentifierValidators.GCN, isNumericIdentifierValidator, isNonGTINNumericIdentifierValidator, isSerializableNumericIdentifierValidator);
|
|
56
|
+
validateMapping(IdentifierTypes.CPID, IdentifierValidators.CPID, isNonNumericIdentifierValidator);
|
|
57
|
+
validateMapping(IdentifierTypes.GMN, IdentifierValidators.GMN, isNonNumericIdentifierValidator);
|
|
34
58
|
});
|
|
35
59
|
|
|
36
60
|
test("Structure", () => {
|
|
37
|
-
validateGTINValidator(
|
|
38
|
-
validateGTINValidator(
|
|
39
|
-
validateGTINValidator(
|
|
40
|
-
validateNonGTINNumericIdentifierValidator(
|
|
41
|
-
validateNonGTINNumericIdentifierValidator(
|
|
42
|
-
validateSerializableNumericIdentifierValidator(
|
|
43
|
-
validateNonNumericIdentifierValidator(
|
|
44
|
-
validateNonGTINNumericIdentifierValidator(
|
|
45
|
-
validateSerializableNumericIdentifierValidator(
|
|
46
|
-
validateNonNumericIdentifierValidator(
|
|
47
|
-
validateNonGTINNumericIdentifierValidator(
|
|
48
|
-
validateSerializableNumericIdentifierValidator(
|
|
49
|
-
validateNonNumericIdentifierValidator(
|
|
50
|
-
validateNonNumericIdentifierValidator(
|
|
61
|
+
validateGTINValidator(IdentifierValidators.GTIN[GTINTypes.GTIN13], false, GTINTypes.GTIN13);
|
|
62
|
+
validateGTINValidator(IdentifierValidators.GTIN[GTINTypes.GTIN12], false, GTINTypes.GTIN12);
|
|
63
|
+
validateGTINValidator(IdentifierValidators.GTIN[GTINTypes.GTIN8], false, GTINTypes.GTIN8);
|
|
64
|
+
validateNonGTINNumericIdentifierValidator(IdentifierValidators.GLN, false, IdentifierTypes.GLN, 13, LeaderTypes.None);
|
|
65
|
+
validateNonGTINNumericIdentifierValidator(IdentifierValidators.SSCC, false, IdentifierTypes.SSCC, 18, LeaderTypes.ExtensionDigit);
|
|
66
|
+
validateSerializableNumericIdentifierValidator(IdentifierValidators.GRAI, false, IdentifierTypes.GRAI, 13, LeaderTypes.None, 16, ContentCharacterSets.AI82);
|
|
67
|
+
validateNonNumericIdentifierValidator(IdentifierValidators.GIAI, false, IdentifierTypes.GIAI, 30, ContentCharacterSets.AI82, false);
|
|
68
|
+
validateNonGTINNumericIdentifierValidator(IdentifierValidators.GSRN, false, IdentifierTypes.GSRN, 18, LeaderTypes.None);
|
|
69
|
+
validateSerializableNumericIdentifierValidator(IdentifierValidators.GDTI, false, IdentifierTypes.GDTI, 13, LeaderTypes.None, 17, ContentCharacterSets.AI82);
|
|
70
|
+
validateNonNumericIdentifierValidator(IdentifierValidators.GINC, false, IdentifierTypes.GINC, 30, ContentCharacterSets.AI82, false);
|
|
71
|
+
validateNonGTINNumericIdentifierValidator(IdentifierValidators.GSIN, false, IdentifierTypes.GSIN, 17, LeaderTypes.None);
|
|
72
|
+
validateSerializableNumericIdentifierValidator(IdentifierValidators.GCN, false, IdentifierTypes.GCN, 13, LeaderTypes.None, 12, ContentCharacterSets.Numeric);
|
|
73
|
+
validateNonNumericIdentifierValidator(IdentifierValidators.CPID, false, IdentifierTypes.CPID, 30, ContentCharacterSets.AI39, false);
|
|
74
|
+
validateNonNumericIdentifierValidator(IdentifierValidators.GMN, false, IdentifierTypes.GMN, 25, ContentCharacterSets.AI82, true);
|
|
51
75
|
});
|
|
52
76
|
});
|
package/tsup.config.ts
ADDED
package/typedoc.json
CHANGED
package/dist/character-set.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CharacterSetCreator, type CharacterSetValidator } from "@aidc-toolkit/utility";
|
|
2
|
-
/**
|
|
3
|
-
* GS1 AI encodable character set 82 creator as defined in section 7.11 of the {@link https://www.gs1.org/genspecs | GS1
|
|
4
|
-
* General Specifications}. Supports {@linkcode Exclusions.AllNumeric}.
|
|
5
|
-
*/
|
|
6
|
-
export declare const AI82_CREATOR: CharacterSetCreator;
|
|
7
|
-
/**
|
|
8
|
-
* GS1 AI encodable character set 82 validator as defined in section 7.11 of the {@link https://www.gs1.org/genspecs |
|
|
9
|
-
* GS1 General Specifications}. Supports {@linkcode Exclusions.AllNumeric}.
|
|
10
|
-
*/
|
|
11
|
-
export declare const AI82_VALIDATOR: CharacterSetValidator;
|
|
12
|
-
/**
|
|
13
|
-
* GS1 AI encodable character set 39 creator as defined in section 7.11 of the {@link https://www.gs1.org/genspecs | GS1
|
|
14
|
-
* General Specifications}. Supports {@linkcode Exclusions.AllNumeric}.
|
|
15
|
-
*/
|
|
16
|
-
export declare const AI39_CREATOR: CharacterSetCreator;
|
|
17
|
-
/**
|
|
18
|
-
* GS1 AI encodable character set 39 validator as defined in section 7.11 of the {@link https://www.gs1.org/genspecs |
|
|
19
|
-
* GS1 General Specifications}. Supports {@linkcode Exclusions.AllNumeric}.
|
|
20
|
-
*/
|
|
21
|
-
export declare const AI39_VALIDATOR: CharacterSetValidator;
|
|
22
|
-
//# sourceMappingURL=character-set.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"character-set.d.ts","sourceRoot":"","sources":["../src/character-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,qBAAqB,EAAc,MAAM,uBAAuB,CAAC;AAEpG;;;GAGG;AACH,eAAO,MAAM,YAAY,qBASA,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAmB,qBAAqB,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,YAAY,qBAKA,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAmB,qBAAqB,CAAC"}
|
package/dist/character-set.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CharacterSetCreator, Exclusions } from "@aidc-toolkit/utility";
|
|
2
|
-
/**
|
|
3
|
-
* GS1 AI encodable character set 82 creator as defined in section 7.11 of the {@link https://www.gs1.org/genspecs | GS1
|
|
4
|
-
* General Specifications}. Supports {@linkcode Exclusions.AllNumeric}.
|
|
5
|
-
*/
|
|
6
|
-
export const AI82_CREATOR = new CharacterSetCreator([
|
|
7
|
-
"!", "\"", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/",
|
|
8
|
-
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
|
|
9
|
-
":", ";", "<", "=", ">", "?",
|
|
10
|
-
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
|
|
11
|
-
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
|
|
12
|
-
"_",
|
|
13
|
-
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
|
|
14
|
-
"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"
|
|
15
|
-
], Exclusions.AllNumeric);
|
|
16
|
-
/**
|
|
17
|
-
* GS1 AI encodable character set 82 validator as defined in section 7.11 of the {@link https://www.gs1.org/genspecs |
|
|
18
|
-
* GS1 General Specifications}. Supports {@linkcode Exclusions.AllNumeric}.
|
|
19
|
-
*/
|
|
20
|
-
export const AI82_VALIDATOR = AI82_CREATOR;
|
|
21
|
-
/**
|
|
22
|
-
* GS1 AI encodable character set 39 creator as defined in section 7.11 of the {@link https://www.gs1.org/genspecs | GS1
|
|
23
|
-
* General Specifications}. Supports {@linkcode Exclusions.AllNumeric}.
|
|
24
|
-
*/
|
|
25
|
-
export const AI39_CREATOR = new CharacterSetCreator([
|
|
26
|
-
"#", "-", "/",
|
|
27
|
-
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
|
|
28
|
-
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
|
|
29
|
-
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
|
|
30
|
-
], Exclusions.AllNumeric);
|
|
31
|
-
/**
|
|
32
|
-
* GS1 AI encodable character set 39 validator as defined in section 7.11 of the {@link https://www.gs1.org/genspecs |
|
|
33
|
-
* GS1 General Specifications}. Supports {@linkcode Exclusions.AllNumeric}.
|
|
34
|
-
*/
|
|
35
|
-
export const AI39_VALIDATOR = AI39_CREATOR;
|
|
36
|
-
//# sourceMappingURL=character-set.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"character-set.js","sourceRoot":"","sources":["../src/character-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA8B,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEpG;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,mBAAmB,CAAC;IAChD,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAChE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAChD,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAC5B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAC/D,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAC/D,GAAG;IACH,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAC/D,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;CAClE,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;AAE1B;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,YAAqC,CAAC;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,mBAAmB,CAAC;IAChD,GAAG,EAAE,GAAG,EAAE,GAAG;IACb,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAChD,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAC/D,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;CAClE,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;AAE1B;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,YAAqC,CAAC"}
|