@aidc-toolkit/gs1 1.0.25-beta → 1.0.26-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/abstract-identifier-creator.d.ts +75 -0
- package/dist/abstract-identifier-creator.d.ts.map +1 -0
- package/dist/abstract-identifier-creator.js +56 -0
- package/dist/abstract-identifier-creator.js.map +1 -0
- package/dist/abstract-identifier-validator.d.ts +95 -0
- package/dist/abstract-identifier-validator.d.ts.map +1 -0
- package/dist/abstract-identifier-validator.js +123 -0
- package/dist/abstract-identifier-validator.js.map +1 -0
- package/dist/abstract-numeric-identifier-creator.d.ts +92 -0
- package/dist/abstract-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/abstract-numeric-identifier-creator.js +137 -0
- package/dist/abstract-numeric-identifier-creator.js.map +1 -0
- package/dist/abstract-numeric-identifier-validator.d.ts +35 -0
- package/dist/abstract-numeric-identifier-validator.d.ts.map +1 -0
- package/dist/abstract-numeric-identifier-validator.js +61 -0
- package/dist/abstract-numeric-identifier-validator.js.map +1 -0
- package/dist/character-set.d.ts +27 -0
- package/dist/character-set.d.ts.map +1 -0
- package/dist/character-set.js +50 -0
- package/dist/character-set.js.map +1 -0
- package/dist/check.d.ts +81 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +218 -0
- package/dist/check.js.map +1 -0
- package/dist/content-character-set.d.ts +26 -0
- package/dist/content-character-set.d.ts.map +1 -0
- package/dist/content-character-set.js +18 -0
- package/dist/content-character-set.js.map +1 -0
- package/dist/creators.d.ts +81 -0
- package/dist/creators.d.ts.map +1 -0
- package/dist/creators.js +62 -0
- package/dist/creators.js.map +1 -0
- package/dist/descriptors.d.ts +96 -0
- package/dist/descriptors.d.ts.map +1 -0
- package/dist/descriptors.js +266 -0
- package/dist/descriptors.js.map +1 -0
- package/dist/gtin-creator.d.ts +69 -0
- package/dist/gtin-creator.d.ts.map +1 -0
- package/dist/gtin-creator.js +159 -0
- package/dist/gtin-creator.js.map +1 -0
- package/dist/gtin-descriptor.d.ts +17 -0
- package/dist/gtin-descriptor.d.ts.map +1 -0
- package/dist/gtin-descriptor.js +2 -0
- package/dist/gtin-descriptor.js.map +1 -0
- package/dist/gtin-type.d.ts +39 -0
- package/dist/gtin-type.d.ts.map +1 -0
- package/dist/gtin-type.js +31 -0
- package/dist/gtin-type.js.map +1 -0
- package/dist/gtin-validator.d.ts +191 -0
- package/dist/gtin-validator.d.ts.map +1 -0
- package/dist/gtin-validator.js +450 -0
- package/dist/gtin-validator.js.map +1 -0
- package/dist/identifier-creator.d.ts +31 -0
- package/dist/identifier-creator.d.ts.map +1 -0
- package/dist/identifier-creator.js +2 -0
- package/dist/identifier-creator.js.map +1 -0
- package/dist/identifier-descriptor.d.ts +27 -0
- package/dist/identifier-descriptor.d.ts.map +1 -0
- package/dist/identifier-descriptor.js +2 -0
- package/dist/identifier-descriptor.js.map +1 -0
- package/dist/identifier-type.d.ts +62 -0
- package/dist/identifier-type.d.ts.map +1 -0
- package/dist/identifier-type.js +54 -0
- package/dist/identifier-type.js.map +1 -0
- package/dist/identifier-validator.d.ts +53 -0
- package/dist/identifier-validator.d.ts.map +1 -0
- package/dist/identifier-validator.js +2 -0
- package/dist/identifier-validator.js.map +1 -0
- package/dist/index.d.ts +52 -1949
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -4727
- package/dist/index.js.map +1 -1
- package/dist/locale/en/locale-resources.d.ts +42 -0
- package/dist/locale/en/locale-resources.d.ts.map +1 -0
- package/dist/locale/en/locale-resources.js +41 -0
- package/dist/locale/en/locale-resources.js.map +1 -0
- package/dist/locale/fr/locale-resources.d.ts +42 -0
- package/dist/locale/fr/locale-resources.d.ts.map +1 -0
- package/dist/locale/fr/locale-resources.js +41 -0
- package/dist/locale/fr/locale-resources.js.map +1 -0
- package/dist/locale/i18n.d.ts +27 -0
- package/dist/locale/i18n.d.ts.map +1 -0
- package/dist/locale/i18n.js +36 -0
- package/dist/locale/i18n.js.map +1 -0
- package/dist/non-gtin-numeric-identifier-creator.d.ts +24 -0
- package/dist/non-gtin-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/non-gtin-numeric-identifier-creator.js +23 -0
- package/dist/non-gtin-numeric-identifier-creator.js.map +1 -0
- package/dist/non-gtin-numeric-identifier-descriptor.d.ts +22 -0
- package/dist/non-gtin-numeric-identifier-descriptor.d.ts.map +1 -0
- package/dist/non-gtin-numeric-identifier-descriptor.js +2 -0
- package/dist/non-gtin-numeric-identifier-descriptor.js.map +1 -0
- package/dist/non-gtin-numeric-identifier-type.d.ts +7 -0
- package/dist/non-gtin-numeric-identifier-type.d.ts.map +1 -0
- package/dist/non-gtin-numeric-identifier-type.js +2 -0
- package/dist/non-gtin-numeric-identifier-type.js.map +1 -0
- package/dist/non-gtin-numeric-identifier-validator.d.ts +17 -0
- package/dist/non-gtin-numeric-identifier-validator.d.ts.map +1 -0
- package/dist/non-gtin-numeric-identifier-validator.js +17 -0
- package/dist/non-gtin-numeric-identifier-validator.js.map +1 -0
- package/dist/non-numeric-identifier-creator.d.ts +45 -0
- package/dist/non-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/non-numeric-identifier-creator.js +84 -0
- package/dist/non-numeric-identifier-creator.js.map +1 -0
- package/dist/non-numeric-identifier-descriptor.d.ts +26 -0
- package/dist/non-numeric-identifier-descriptor.d.ts.map +1 -0
- package/dist/non-numeric-identifier-descriptor.js +2 -0
- package/dist/non-numeric-identifier-descriptor.js.map +1 -0
- package/dist/non-numeric-identifier-type.d.ts +7 -0
- package/dist/non-numeric-identifier-type.d.ts.map +1 -0
- package/dist/non-numeric-identifier-type.js +2 -0
- package/dist/non-numeric-identifier-type.js.map +1 -0
- package/dist/non-numeric-identifier-validator.d.ts +49 -0
- package/dist/non-numeric-identifier-validator.d.ts.map +1 -0
- package/dist/non-numeric-identifier-validator.js +69 -0
- package/dist/non-numeric-identifier-validator.js.map +1 -0
- package/dist/numeric-identifier-creator.d.ts +53 -0
- package/dist/numeric-identifier-creator.d.ts.map +1 -0
- package/dist/numeric-identifier-creator.js +2 -0
- package/dist/numeric-identifier-creator.js.map +1 -0
- package/dist/numeric-identifier-descriptor.d.ts +21 -0
- package/dist/numeric-identifier-descriptor.d.ts.map +1 -0
- package/dist/numeric-identifier-descriptor.js +2 -0
- package/dist/numeric-identifier-descriptor.js.map +1 -0
- package/dist/numeric-identifier-type.d.ts +31 -0
- package/dist/numeric-identifier-type.d.ts.map +1 -0
- package/dist/numeric-identifier-type.js +18 -0
- package/dist/numeric-identifier-type.js.map +1 -0
- package/dist/numeric-identifier-validator.d.ts +24 -0
- package/dist/numeric-identifier-validator.d.ts.map +1 -0
- package/dist/numeric-identifier-validator.js +2 -0
- package/dist/numeric-identifier-validator.js.map +1 -0
- package/dist/prefix-manager.d.ts +232 -0
- package/dist/prefix-manager.d.ts.map +1 -0
- package/dist/prefix-manager.js +334 -0
- package/dist/prefix-manager.js.map +1 -0
- package/dist/prefix-provider.d.ts +27 -0
- package/dist/prefix-provider.d.ts.map +1 -0
- package/dist/prefix-provider.js +2 -0
- package/dist/prefix-provider.js.map +1 -0
- package/dist/prefix-type.d.ts +26 -0
- package/dist/prefix-type.d.ts.map +1 -0
- package/dist/prefix-type.js +18 -0
- package/dist/prefix-type.js.map +1 -0
- package/dist/prefix-validator.d.ts +70 -0
- package/dist/prefix-validator.d.ts.map +1 -0
- package/dist/prefix-validator.js +208 -0
- package/dist/prefix-validator.js.map +1 -0
- package/dist/serializable-numeric-identifier-creator.d.ts +76 -0
- package/dist/serializable-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/serializable-numeric-identifier-creator.js +107 -0
- package/dist/serializable-numeric-identifier-creator.js.map +1 -0
- package/dist/serializable-numeric-identifier-descriptor.d.ts +26 -0
- package/dist/serializable-numeric-identifier-descriptor.d.ts.map +1 -0
- package/dist/serializable-numeric-identifier-descriptor.js +2 -0
- package/dist/serializable-numeric-identifier-descriptor.js.map +1 -0
- package/dist/serializable-numeric-identifier-type.d.ts +6 -0
- package/dist/serializable-numeric-identifier-type.d.ts.map +1 -0
- package/dist/serializable-numeric-identifier-type.js +2 -0
- package/dist/serializable-numeric-identifier-type.js.map +1 -0
- package/dist/serializable-numeric-identifier-validator.d.ts +56 -0
- package/dist/serializable-numeric-identifier-validator.d.ts.map +1 -0
- package/dist/serializable-numeric-identifier-validator.js +77 -0
- package/dist/serializable-numeric-identifier-validator.js.map +1 -0
- package/dist/validators.d.ts +96 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/validators.js +140 -0
- package/dist/validators.js.map +1 -0
- package/package.json +11 -7
- package/src/abstract-identifier-creator.ts +4 -4
- package/src/abstract-identifier-validator.ts +6 -6
- package/src/abstract-numeric-identifier-creator.ts +7 -7
- package/src/abstract-numeric-identifier-validator.ts +6 -6
- package/src/check.ts +2 -2
- package/src/creators.ts +11 -11
- package/src/descriptors.ts +14 -14
- package/src/gtin-creator.ts +6 -6
- package/src/gtin-descriptor.ts +3 -3
- package/src/gtin-type.ts +2 -2
- package/src/gtin-validator.ts +8 -8
- package/src/identifier-creator.ts +3 -3
- package/src/identifier-descriptor.ts +3 -3
- package/src/identifier-validator.ts +1 -1
- package/src/index.ts +44 -43
- package/src/locale/i18n.ts +3 -3
- package/src/locale/i18next.d.ts +1 -1
- package/src/non-gtin-numeric-identifier-creator.ts +5 -5
- package/src/non-gtin-numeric-identifier-descriptor.ts +4 -4
- package/src/non-gtin-numeric-identifier-type.ts +2 -2
- package/src/non-gtin-numeric-identifier-validator.ts +5 -5
- package/src/non-numeric-identifier-creator.ts +6 -6
- package/src/non-numeric-identifier-descriptor.ts +4 -4
- package/src/non-numeric-identifier-type.ts +2 -2
- package/src/non-numeric-identifier-validator.ts +7 -7
- package/src/numeric-identifier-creator.ts +3 -3
- package/src/numeric-identifier-descriptor.ts +3 -3
- package/src/numeric-identifier-type.ts +1 -1
- package/src/numeric-identifier-validator.ts +2 -2
- package/src/prefix-manager.ts +16 -16
- package/src/prefix-provider.ts +1 -1
- package/src/prefix-validator.ts +3 -3
- package/src/serializable-numeric-identifier-creator.ts +4 -4
- package/src/serializable-numeric-identifier-descriptor.ts +4 -4
- package/src/serializable-numeric-identifier-type.ts +1 -1
- package/src/serializable-numeric-identifier-validator.ts +7 -7
- package/src/validators.ts +12 -12
- package/test/check.test.ts +1 -1
- package/test/creator.test.ts +5 -5
- package/test/gtin-creator.ts +2 -2
- package/test/gtin-validator.test.ts +2 -2
- package/test/identifier-creator.ts +5 -5
- package/test/identifier-validator.ts +1 -1
- package/test/non-gtin-numeric-identifier-creator.ts +3 -3
- package/test/non-gtin-numeric-identifier-validator.ts +2 -2
- package/test/non-numeric-identifier-creator.ts +1 -1
- package/test/non-numeric-identifier-validator.ts +3 -3
- package/test/numeric-identifier-creator.ts +2 -2
- package/test/numeric-identifier-validator.ts +2 -2
- package/test/prefix-manager.test.ts +2 -2
- package/test/serializable-numeric-identifier-creator.ts +2 -2
- package/test/serializable-numeric-identifier-validator.ts +3 -3
- package/test/setup.ts +1 -1
- package/test/sparse.test.ts +1 -1
- package/test/utility.ts +1 -1
- package/test/validator.test.ts +5 -5
- package/test/variable-measure-rcn.test.ts +1 -1
- package/tsconfig-config.json +4 -0
- package/tsconfig-src.json +8 -0
- package/tsconfig-test.json +9 -0
- package/tsconfig.json +12 -1
- package/tsup.config.ts +3 -2
- package/dist/index.cjs +0 -4813
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -1949
package/src/locale/i18n.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i18nCoreInit, type I18nEnvironment } from "@aidc-toolkit/core";
|
|
2
2
|
import { i18nUtilityInit, utilityResources } from "@aidc-toolkit/utility";
|
|
3
3
|
import i18next, { type i18n, type Resource } from "i18next";
|
|
4
|
-
import enLocaleResources from "./en/locale-resources";
|
|
5
|
-
import frLocaleResources from "./fr/locale-resources";
|
|
4
|
+
import enLocaleResources from "./en/locale-resources.js";
|
|
5
|
+
import frLocaleResources from "./fr/locale-resources.js";
|
|
6
6
|
|
|
7
7
|
export const gs1NS = "aidct_gs1";
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ export const gs1Resources: Resource = {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
// Explicit type is necessary
|
|
26
|
+
// Explicit type is necessary because type can't be inferred without additional references.
|
|
27
27
|
export const i18nextGS1: i18n = i18next.createInstance();
|
|
28
28
|
|
|
29
29
|
/**
|
package/src/locale/i18next.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Mixin } from "ts-mixer";
|
|
2
|
-
import { AbstractNumericIdentifierCreator } from "./abstract-numeric-identifier-creator";
|
|
3
|
-
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type";
|
|
4
|
-
import { NonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator";
|
|
5
|
-
import type { PrefixProvider } from "./prefix-provider";
|
|
6
|
-
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type";
|
|
2
|
+
import { AbstractNumericIdentifierCreator } from "./abstract-numeric-identifier-creator.js";
|
|
3
|
+
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type.js";
|
|
4
|
+
import { NonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator.js";
|
|
5
|
+
import type { PrefixProvider } from "./prefix-provider.js";
|
|
6
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Non-GTIN numeric identifier creator.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type";
|
|
2
|
-
import type { NumericIdentifierDescriptor } from "./numeric-identifier-descriptor";
|
|
3
|
-
import type { LeaderType, LeaderTypes } from "./numeric-identifier-type";
|
|
4
|
-
import type { PrefixTypes } from "./prefix-type";
|
|
1
|
+
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type.js";
|
|
2
|
+
import type { NumericIdentifierDescriptor } from "./numeric-identifier-descriptor.js";
|
|
3
|
+
import type { LeaderType, LeaderTypes } from "./numeric-identifier-type.js";
|
|
4
|
+
import type { PrefixTypes } from "./prefix-type.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Non-GTIN numeric identifier descriptor.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IdentifierTypes } from "./identifier-type";
|
|
2
|
-
import type { NumericIdentifierType } from "./numeric-identifier-type";
|
|
1
|
+
import type { IdentifierTypes } from "./identifier-type.js";
|
|
2
|
+
import type { NumericIdentifierType } from "./numeric-identifier-type.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Non-GTIN numeric identifier type.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AbstractNumericIdentifierValidator } from "./abstract-numeric-identifier-validator";
|
|
2
|
-
import { IdentifierDescriptors } from "./descriptors";
|
|
3
|
-
import type { NonGTINNumericIdentifierDescriptor } from "./non-gtin-numeric-identifier-descriptor";
|
|
4
|
-
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type";
|
|
5
|
-
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type";
|
|
1
|
+
import { AbstractNumericIdentifierValidator } from "./abstract-numeric-identifier-validator.js";
|
|
2
|
+
import { IdentifierDescriptors } from "./descriptors.js";
|
|
3
|
+
import type { NonGTINNumericIdentifierDescriptor } from "./non-gtin-numeric-identifier-descriptor.js";
|
|
4
|
+
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type.js";
|
|
5
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Non-GTIN numeric identifier validator.
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
type TransformerOutput
|
|
6
6
|
} from "@aidc-toolkit/utility";
|
|
7
7
|
import { Mixin } from "ts-mixer";
|
|
8
|
-
import { AbstractIdentifierCreator } from "./abstract-identifier-creator";
|
|
9
|
-
import { checkCharacterPair } from "./check";
|
|
10
|
-
import { i18nextGS1 } from "./locale/i18n";
|
|
11
|
-
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type";
|
|
12
|
-
import { NonNumericIdentifierValidator } from "./non-numeric-identifier-validator";
|
|
13
|
-
import type { PrefixProvider } from "./prefix-provider";
|
|
8
|
+
import { AbstractIdentifierCreator } from "./abstract-identifier-creator.js";
|
|
9
|
+
import { checkCharacterPair } from "./check.js";
|
|
10
|
+
import { i18nextGS1 } from "./locale/i18n.js";
|
|
11
|
+
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type.js";
|
|
12
|
+
import { NonNumericIdentifierValidator } from "./non-numeric-identifier-validator.js";
|
|
13
|
+
import type { PrefixProvider } from "./prefix-provider.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Non-numeric identifier creator.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ContentCharacterSet, ContentCharacterSets } from "./content-character-set";
|
|
2
|
-
import type { IdentifierDescriptor } from "./identifier-descriptor";
|
|
3
|
-
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type";
|
|
4
|
-
import type { PrefixTypes } from "./prefix-type";
|
|
1
|
+
import type { ContentCharacterSet, ContentCharacterSets } from "./content-character-set.js";
|
|
2
|
+
import type { IdentifierDescriptor } from "./identifier-descriptor.js";
|
|
3
|
+
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type.js";
|
|
4
|
+
import type { PrefixTypes } from "./prefix-type.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Non-numeric identifier descriptor.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IdentifierType } from "./identifier-type";
|
|
2
|
-
import type { NumericIdentifierType } from "./numeric-identifier-type";
|
|
1
|
+
import type { IdentifierType } from "./identifier-type.js";
|
|
2
|
+
import type { NumericIdentifierType } from "./numeric-identifier-type.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Non-numeric identifier type.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Exclusions, RegExpValidator } from "@aidc-toolkit/utility";
|
|
2
|
-
import { AbstractIdentifierValidator } from "./abstract-identifier-validator";
|
|
3
|
-
import { hasValidCheckCharacterPair } from "./check";
|
|
4
|
-
import { IdentifierDescriptors } from "./descriptors";
|
|
5
|
-
import type { IdentifierValidation } from "./identifier-validator";
|
|
6
|
-
import { i18nextGS1 } from "./locale/i18n";
|
|
7
|
-
import type { NonNumericIdentifierDescriptor } from "./non-numeric-identifier-descriptor";
|
|
8
|
-
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type";
|
|
2
|
+
import { AbstractIdentifierValidator } from "./abstract-identifier-validator.js";
|
|
3
|
+
import { hasValidCheckCharacterPair } from "./check.js";
|
|
4
|
+
import { IdentifierDescriptors } from "./descriptors.js";
|
|
5
|
+
import type { IdentifierValidation } from "./identifier-validator.js";
|
|
6
|
+
import { i18nextGS1 } from "./locale/i18n.js";
|
|
7
|
+
import type { NonNumericIdentifierDescriptor } from "./non-numeric-identifier-descriptor.js";
|
|
8
|
+
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Non-numeric identifier validation parameters.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TransformerInput, TransformerOutput } from "@aidc-toolkit/utility";
|
|
2
|
-
import type { IdentifierCreator } from "./identifier-creator";
|
|
3
|
-
import type { NumericIdentifierDescriptor } from "./numeric-identifier-descriptor";
|
|
4
|
-
import type { NumericIdentifierValidation, NumericIdentifierValidator } from "./numeric-identifier-validator";
|
|
2
|
+
import type { IdentifierCreator } from "./identifier-creator.js";
|
|
3
|
+
import type { NumericIdentifierDescriptor } from "./numeric-identifier-descriptor.js";
|
|
4
|
+
import type { NumericIdentifierValidation, NumericIdentifierValidator } from "./numeric-identifier-validator.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Numeric identifier creator. Creates one or many numeric identifiers.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ContentCharacterSets } from "./content-character-set";
|
|
2
|
-
import type { IdentifierDescriptor } from "./identifier-descriptor";
|
|
3
|
-
import type { LeaderType, NumericIdentifierType } from "./numeric-identifier-type";
|
|
1
|
+
import type { ContentCharacterSets } from "./content-character-set.js";
|
|
2
|
+
import type { IdentifierDescriptor } from "./identifier-descriptor.js";
|
|
3
|
+
import type { LeaderType, NumericIdentifierType } from "./numeric-identifier-type.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Numeric identifier descriptor.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IdentifierValidation, IdentifierValidator } from "./identifier-validator";
|
|
2
|
-
import type { NumericIdentifierDescriptor } from "./numeric-identifier-descriptor";
|
|
1
|
+
import type { IdentifierValidation, IdentifierValidator } from "./identifier-validator.js";
|
|
2
|
+
import type { NumericIdentifierDescriptor } from "./numeric-identifier-descriptor.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Numeric identifier validation parameters.
|
package/src/prefix-manager.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { type IdentifierCreatorsRecord, isNumericIdentifierCreator } from "./creators";
|
|
2
|
-
import { GTINCreator } from "./gtin-creator";
|
|
3
|
-
import { GTIN_BASE_TYPES } from "./gtin-type";
|
|
4
|
-
import type { IdentifierCreator } from "./identifier-creator";
|
|
5
|
-
import { type IdentifierType, IdentifierTypes } from "./identifier-type";
|
|
6
|
-
import { i18nextGS1 } from "./locale/i18n";
|
|
7
|
-
import { NonGTINNumericIdentifierCreator } from "./non-gtin-numeric-identifier-creator";
|
|
8
|
-
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type";
|
|
9
|
-
import { NonNumericIdentifierCreator } from "./non-numeric-identifier-creator";
|
|
10
|
-
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type";
|
|
11
|
-
import type { NumericIdentifierType } from "./numeric-identifier-type";
|
|
12
|
-
import type { PrefixProvider } from "./prefix-provider";
|
|
13
|
-
import { type PrefixType, PrefixTypes } from "./prefix-type";
|
|
14
|
-
import { PrefixValidator } from "./prefix-validator";
|
|
15
|
-
import { SerializableNumericIdentifierCreator } from "./serializable-numeric-identifier-creator";
|
|
16
|
-
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type";
|
|
1
|
+
import { type IdentifierCreatorsRecord, isNumericIdentifierCreator } from "./creators.js";
|
|
2
|
+
import { GTINCreator } from "./gtin-creator.js";
|
|
3
|
+
import { GTIN_BASE_TYPES } from "./gtin-type.js";
|
|
4
|
+
import type { IdentifierCreator } from "./identifier-creator.js";
|
|
5
|
+
import { type IdentifierType, IdentifierTypes } from "./identifier-type.js";
|
|
6
|
+
import { i18nextGS1 } from "./locale/i18n.js";
|
|
7
|
+
import { NonGTINNumericIdentifierCreator } from "./non-gtin-numeric-identifier-creator.js";
|
|
8
|
+
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type.js";
|
|
9
|
+
import { NonNumericIdentifierCreator } from "./non-numeric-identifier-creator.js";
|
|
10
|
+
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type.js";
|
|
11
|
+
import type { NumericIdentifierType } from "./numeric-identifier-type.js";
|
|
12
|
+
import type { PrefixProvider } from "./prefix-provider.js";
|
|
13
|
+
import { type PrefixType, PrefixTypes } from "./prefix-type.js";
|
|
14
|
+
import { PrefixValidator } from "./prefix-validator.js";
|
|
15
|
+
import { SerializableNumericIdentifierCreator } from "./serializable-numeric-identifier-creator.js";
|
|
16
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Prefix manager. This is the core class for identifier creation.
|
package/src/prefix-provider.ts
CHANGED
package/src/prefix-validator.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CharacterSetValidation, NUMERIC_CREATOR } from "@aidc-toolkit/utility";
|
|
2
|
-
import { i18nextGS1 } from "./locale/i18n";
|
|
3
|
-
import type { PrefixProvider } from "./prefix-provider";
|
|
4
|
-
import { type PrefixType, PrefixTypes } from "./prefix-type";
|
|
2
|
+
import { i18nextGS1 } from "./locale/i18n.js";
|
|
3
|
+
import type { PrefixProvider } from "./prefix-provider.js";
|
|
4
|
+
import { type PrefixType, PrefixTypes } from "./prefix-type.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Prefix validation parameters.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { mapIterable, type TransformerInput, type TransformerOutput } from "@aidc-toolkit/utility";
|
|
2
2
|
import { Mixin } from "ts-mixer";
|
|
3
|
-
import { AbstractNumericIdentifierCreator } from "./abstract-numeric-identifier-creator";
|
|
4
|
-
import type { PrefixProvider } from "./prefix-provider";
|
|
5
|
-
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type";
|
|
6
|
-
import { SerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator";
|
|
3
|
+
import { AbstractNumericIdentifierCreator } from "./abstract-numeric-identifier-creator.js";
|
|
4
|
+
import type { PrefixProvider } from "./prefix-provider.js";
|
|
5
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
6
|
+
import { SerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Serializable numeric identifier creator.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ContentCharacterSet } from "./content-character-set";
|
|
2
|
-
import type { NonGTINNumericIdentifierDescriptor } from "./non-gtin-numeric-identifier-descriptor";
|
|
3
|
-
import type { LeaderTypes } from "./numeric-identifier-type";
|
|
4
|
-
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type";
|
|
1
|
+
import type { ContentCharacterSet } from "./content-character-set.js";
|
|
2
|
+
import type { NonGTINNumericIdentifierDescriptor } from "./non-gtin-numeric-identifier-descriptor.js";
|
|
3
|
+
import type { LeaderTypes } from "./numeric-identifier-type.js";
|
|
4
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Serializable numeric identifier descriptor.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { CharacterSetCreator, CharacterSetValidation } from "@aidc-toolkit/utility";
|
|
2
|
-
import { AbstractNumericIdentifierValidator } from "./abstract-numeric-identifier-validator";
|
|
3
|
-
import type { ContentCharacterSet } from "./content-character-set";
|
|
4
|
-
import { IdentifierDescriptors } from "./descriptors";
|
|
5
|
-
import type { IdentifierValidation } from "./identifier-validator";
|
|
6
|
-
import { i18nextGS1 } from "./locale/i18n";
|
|
7
|
-
import type { SerializableNumericIdentifierDescriptor } from "./serializable-numeric-identifier-descriptor";
|
|
8
|
-
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type";
|
|
2
|
+
import { AbstractNumericIdentifierValidator } from "./abstract-numeric-identifier-validator.js";
|
|
3
|
+
import type { ContentCharacterSet } from "./content-character-set.js";
|
|
4
|
+
import { IdentifierDescriptors } from "./descriptors.js";
|
|
5
|
+
import type { IdentifierValidation } from "./identifier-validator.js";
|
|
6
|
+
import { i18nextGS1 } from "./locale/i18n.js";
|
|
7
|
+
import type { SerializableNumericIdentifierDescriptor } from "./serializable-numeric-identifier-descriptor.js";
|
|
8
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Serializable numeric identifier validator. Validates both serialized and non-serialized forms of numeric identifiers
|
package/src/validators.ts
CHANGED
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
isNonNumericIdentifierDescriptor,
|
|
6
6
|
isNumericIdentifierDescriptor,
|
|
7
7
|
isSerializableNumericIdentifierDescriptor
|
|
8
|
-
} from "./descriptors";
|
|
9
|
-
import type { GTINBaseType } from "./gtin-type";
|
|
10
|
-
import { GTIN_VALIDATORS, type GTINValidator } from "./gtin-validator";
|
|
11
|
-
import { type IdentifierType, IdentifierTypes } from "./identifier-type";
|
|
12
|
-
import type { IdentifierValidator } from "./identifier-validator";
|
|
13
|
-
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type";
|
|
14
|
-
import { NonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator";
|
|
15
|
-
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type";
|
|
16
|
-
import { NonNumericIdentifierValidator } from "./non-numeric-identifier-validator";
|
|
17
|
-
import type { NumericIdentifierValidator } from "./numeric-identifier-validator";
|
|
18
|
-
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type";
|
|
19
|
-
import { SerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator";
|
|
8
|
+
} from "./descriptors.js";
|
|
9
|
+
import type { GTINBaseType } from "./gtin-type.js";
|
|
10
|
+
import { GTIN_VALIDATORS, type GTINValidator } from "./gtin-validator.js";
|
|
11
|
+
import { type IdentifierType, IdentifierTypes } from "./identifier-type.js";
|
|
12
|
+
import type { IdentifierValidator } from "./identifier-validator.js";
|
|
13
|
+
import type { NonGTINNumericIdentifierType } from "./non-gtin-numeric-identifier-type.js";
|
|
14
|
+
import { NonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator.js";
|
|
15
|
+
import type { NonNumericIdentifierType } from "./non-numeric-identifier-type.js";
|
|
16
|
+
import { NonNumericIdentifierValidator } from "./non-numeric-identifier-validator.js";
|
|
17
|
+
import type { NumericIdentifierValidator } from "./numeric-identifier-validator.js";
|
|
18
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
19
|
+
import { SerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator.js";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* GLN validator.
|
package/test/check.test.ts
CHANGED
package/test/creator.test.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { describe } from "vitest";
|
|
2
|
-
import { PrefixManager, PrefixTypes } from "../src";
|
|
3
|
-
import { testGTINCreator } from "./gtin-creator";
|
|
4
|
-
import { testNonGTINNumericIdentifierCreator } from "./non-gtin-numeric-identifier-creator";
|
|
5
|
-
import { testNonNumericIdentifierCreator } from "./non-numeric-identifier-creator";
|
|
6
|
-
import { testSerializableNumericIdentifierCreator } from "./serializable-numeric-identifier-creator";
|
|
2
|
+
import { PrefixManager, PrefixTypes } from "../src/index.js";
|
|
3
|
+
import { testGTINCreator } from "./gtin-creator.js";
|
|
4
|
+
import { testNonGTINNumericIdentifierCreator } from "./non-gtin-numeric-identifier-creator.js";
|
|
5
|
+
import { testNonNumericIdentifierCreator } from "./non-numeric-identifier-creator.js";
|
|
6
|
+
import { testSerializableNumericIdentifierCreator } from "./serializable-numeric-identifier-creator.js";
|
|
7
7
|
|
|
8
8
|
describe("Creators", () => {
|
|
9
9
|
testGTINCreator(PrefixManager.get(PrefixTypes.GS1CompanyPrefix, "952123456").gtinCreator);
|
package/test/gtin-creator.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CharacterSetCreator, Sequence } from "@aidc-toolkit/utility";
|
|
2
2
|
import { expect, test } from "vitest";
|
|
3
|
-
import { type GTINCreator, GTINTypes, GTINValidator, hasValidCheckDigit, isGTINCreator, PrefixTypes } from "../src";
|
|
4
|
-
import { testNumericIdentifierCreator } from "./numeric-identifier-creator";
|
|
3
|
+
import { type GTINCreator, GTINTypes, GTINValidator, hasValidCheckDigit, isGTINCreator, PrefixTypes } from "../src/index.js";
|
|
4
|
+
import { testNumericIdentifierCreator } from "./numeric-identifier-creator.js";
|
|
5
5
|
|
|
6
6
|
export function testGTINCreator(creator: GTINCreator): void {
|
|
7
7
|
testNumericIdentifierCreator(creator, () => {
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
LeaderTypes,
|
|
9
9
|
type PrefixType,
|
|
10
10
|
PrefixTypes
|
|
11
|
-
} from "../src";
|
|
12
|
-
import { validateNumericIdentifierValidator } from "./numeric-identifier-validator";
|
|
11
|
+
} from "../src/index.js";
|
|
12
|
+
import { validateNumericIdentifierValidator } from "./numeric-identifier-validator.js";
|
|
13
13
|
|
|
14
14
|
export function validateGTINValidator(validator: GTINValidator, isCreator: boolean, gtinBaseType: GTINBaseType): void {
|
|
15
15
|
let prefixType: PrefixType;
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
LeaderTypes,
|
|
8
8
|
type PrefixManager,
|
|
9
9
|
PrefixTypes
|
|
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";
|
|
10
|
+
} from "../src/index.js";
|
|
11
|
+
import { validateGTINValidator } from "./gtin-validator.test.js";
|
|
12
|
+
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator.js";
|
|
13
|
+
import { validateNonNumericIdentifierValidator } from "./non-numeric-identifier-validator.js";
|
|
14
|
+
import { validateSerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator.js";
|
|
15
15
|
|
|
16
16
|
export function validateIdentifierCreators(prefixManager: PrefixManager): void {
|
|
17
17
|
let gtinType: GTINType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from "vitest";
|
|
2
|
-
import type { IdentifierType, IdentifierTypeValidator, PrefixType } from "../src";
|
|
2
|
+
import type { IdentifierType, IdentifierTypeValidator, PrefixType } from "../src/index.js";
|
|
3
3
|
|
|
4
4
|
export function validateIdentifierValidator<TIdentifierType extends IdentifierType>(creator: IdentifierTypeValidator<TIdentifierType>, identifierType: IdentifierType, prefixType: PrefixType, length: number): void {
|
|
5
5
|
expect(creator.identifierType).toBe(identifierType);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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";
|
|
2
|
+
import { isNonGTINNumericIdentifierCreator, type NonGTINNumericIdentifierCreator } from "../src/index.js";
|
|
3
|
+
import { testIdentifierCreatorCallback } from "./identifier-creator.js";
|
|
4
|
+
import { testNumericIdentifierCreator } from "./numeric-identifier-creator.js";
|
|
5
5
|
|
|
6
6
|
export function testNonGTINNumericIdentifierCreator(creator: NonGTINNumericIdentifierCreator, preTestCallback?: () => void, postTestCallback?: () => void): void {
|
|
7
7
|
testNumericIdentifierCreator(creator, () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type IdentifierType, type LeaderType, type NonGTINNumericIdentifierValidator, PrefixTypes } from "../src";
|
|
2
|
-
import { validateNumericIdentifierValidator } from "./numeric-identifier-validator";
|
|
1
|
+
import { type IdentifierType, type LeaderType, type NonGTINNumericIdentifierValidator, PrefixTypes } from "../src/index.js";
|
|
2
|
+
import { validateNumericIdentifierValidator } from "./numeric-identifier-validator.js";
|
|
3
3
|
|
|
4
4
|
export function validateNonGTINNumericIdentifierValidator(validator: NonGTINNumericIdentifierValidator, isCreator: boolean, identifierType: IdentifierType, length: number, leaderType: LeaderType): void {
|
|
5
5
|
validateNumericIdentifierValidator(validator, identifierType, PrefixTypes.GS1CompanyPrefix, length, leaderType);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Exclusions, Sequence } from "@aidc-toolkit/utility";
|
|
2
2
|
import { describe, expect, test } from "vitest";
|
|
3
|
-
import { hasValidCheckCharacterPair, isNonNumericIdentifierCreator, type NonNumericIdentifierCreator } from "../src";
|
|
3
|
+
import { hasValidCheckCharacterPair, isNonNumericIdentifierCreator, type NonNumericIdentifierCreator } from "../src/index.js";
|
|
4
4
|
|
|
5
5
|
const TEST_REFERENCE_LENGTH = 2;
|
|
6
6
|
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
type NonNumericIdentifierCreator,
|
|
6
6
|
type NonNumericIdentifierValidator,
|
|
7
7
|
PrefixTypes
|
|
8
|
-
} from "../src";
|
|
9
|
-
import { validateIdentifierValidator } from "./identifier-validator";
|
|
10
|
-
import { creatorFor } from "./utility";
|
|
8
|
+
} from "../src/index.js";
|
|
9
|
+
import { validateIdentifierValidator } from "./identifier-validator.js";
|
|
10
|
+
import { creatorFor } from "./utility.js";
|
|
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);
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
LeaderTypes,
|
|
7
7
|
type NumericIdentifierCreator,
|
|
8
8
|
type NumericIdentifierDescriptor
|
|
9
|
-
} from "../src";
|
|
10
|
-
import { testIdentifierCreatorCallback } from "./identifier-creator";
|
|
9
|
+
} from "../src/index.js";
|
|
10
|
+
import { testIdentifierCreatorCallback } from "./identifier-creator.js";
|
|
11
11
|
|
|
12
12
|
export function testNumericIdentifierCreator<TNumericIdentifierDescriptor extends NumericIdentifierDescriptor>(creator: NumericIdentifierCreator<TNumericIdentifierDescriptor>, preTestCallback?: () => void, postTestCallback?: () => void): void {
|
|
13
13
|
describe(isGTINCreator(creator) ? `${creator.identifierType}-${creator.length}` : creator.identifierType as string, () => {
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
type LeaderType,
|
|
8
8
|
type NumericIdentifierType,
|
|
9
9
|
type PrefixType
|
|
10
|
-
} from "../src";
|
|
11
|
-
import { validateIdentifierValidator } from "./identifier-validator";
|
|
10
|
+
} from "../src/index.js";
|
|
11
|
+
import { validateIdentifierValidator } from "./identifier-validator.js";
|
|
12
12
|
|
|
13
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);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "vitest";
|
|
2
|
-
import { PrefixManager, PrefixTypes } from "../src";
|
|
3
|
-
import { validateIdentifierCreators } from "./identifier-creator";
|
|
2
|
+
import { PrefixManager, PrefixTypes } from "../src/index.js";
|
|
3
|
+
import { validateIdentifierCreators } from "./identifier-creator.js";
|
|
4
4
|
|
|
5
5
|
describe("Prefix manager", () => {
|
|
6
6
|
let prefixManager: PrefixManager;
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
ContentCharacterSets,
|
|
4
4
|
isSerializableNumericIdentifierCreator,
|
|
5
5
|
type SerializableNumericIdentifierCreator
|
|
6
|
-
} from "../src";
|
|
7
|
-
import { testNonGTINNumericIdentifierCreator } from "./non-gtin-numeric-identifier-creator";
|
|
6
|
+
} from "../src/index.js";
|
|
7
|
+
import { testNonGTINNumericIdentifierCreator } from "./non-gtin-numeric-identifier-creator.js";
|
|
8
8
|
|
|
9
9
|
export function testSerializableNumericIdentifierCreator(creator: SerializableNumericIdentifierCreator): void {
|
|
10
10
|
testNonGTINNumericIdentifierCreator(creator, () => {
|
|
@@ -5,9 +5,9 @@ import type {
|
|
|
5
5
|
LeaderType,
|
|
6
6
|
SerializableNumericIdentifierCreator,
|
|
7
7
|
SerializableNumericIdentifierValidator
|
|
8
|
-
} from "../src";
|
|
9
|
-
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator";
|
|
10
|
-
import { creatorFor } from "./utility";
|
|
8
|
+
} from "../src/index.js";
|
|
9
|
+
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator.js";
|
|
10
|
+
import { creatorFor } from "./utility.js";
|
|
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/setup.ts
CHANGED
package/test/sparse.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Sequence } from "@aidc-toolkit/utility";
|
|
2
2
|
import { describe, expect, test } from "vitest";
|
|
3
|
-
import { PrefixManager, PrefixTypes } from "../src";
|
|
3
|
+
import { PrefixManager, PrefixTypes } from "../src/index.js";
|
|
4
4
|
|
|
5
5
|
describe("Sparse creation", () => {
|
|
6
6
|
const prefixManager = PrefixManager.get(PrefixTypes.GS1CompanyPrefix, "9521234");
|
package/test/utility.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CharacterSetCreator, NUMERIC_CREATOR } from "@aidc-toolkit/utility";
|
|
2
|
-
import { AI39_CREATOR, AI82_CREATOR, type ContentCharacterSet, ContentCharacterSets } from "../src";
|
|
2
|
+
import { AI39_CREATOR, AI82_CREATOR, type ContentCharacterSet, ContentCharacterSets } from "../src/index.js";
|
|
3
3
|
|
|
4
4
|
export function creatorFor(characterSet: ContentCharacterSet): CharacterSetCreator {
|
|
5
5
|
let creator: CharacterSetCreator;
|
package/test/validator.test.ts
CHANGED
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
isNumericIdentifierValidator,
|
|
16
16
|
isSerializableNumericIdentifierValidator,
|
|
17
17
|
LeaderTypes
|
|
18
|
-
} from "../src";
|
|
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";
|
|
18
|
+
} from "../src/index.js";
|
|
19
|
+
import { validateGTINValidator } from "./gtin-validator.test.js";
|
|
20
|
+
import { validateNonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator.js";
|
|
21
|
+
import { validateNonNumericIdentifierValidator } from "./non-numeric-identifier-validator.js";
|
|
22
|
+
import { validateSerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator.js";
|
|
23
23
|
|
|
24
24
|
describe("Validators", () => {
|
|
25
25
|
function validateMapping(identifierType: IdentifierType, expectedIdentifierValidatorsOrValidator: Readonly<Record<GTINBaseType, GTINValidator>> | IdentifierValidator, ...isIdentifierValidatorTypes: Array<(validator: IdentifierValidator) => boolean>): void {
|