@aidc-toolkit/gs1 0.9.14-beta → 0.9.15-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/character-set.d.ts +12 -0
- package/dist/character-set.d.ts.map +1 -0
- package/dist/check.d.ts +79 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/idkey.d.ts +1262 -0
- package/dist/idkey.d.ts.map +1 -0
- package/dist/index.cjs +2051 -1
- package/dist/index.d.ts +21 -1497
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1978 -1
- package/dist/locale/en/locale-strings.d.ts +38 -0
- package/dist/locale/en/locale-strings.d.ts.map +1 -0
- package/dist/locale/fr/locale-strings.d.ts +38 -0
- package/dist/locale/fr/locale-strings.d.ts.map +1 -0
- package/dist/locale/i18n.d.ts +106 -0
- package/dist/locale/i18n.d.ts.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CharacterSetCreator } 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 Exclusion.AllNumeric}.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AI82_CREATOR: CharacterSetCreator;
|
|
7
|
+
/**
|
|
8
|
+
* GS1 AI encodable character set 39 creator as defined in section 7.11 of the {@link https://www.gs1.org/genspecs | GS1
|
|
9
|
+
* General Specifications}. Supports {@linkcode Exclusion.AllNumeric}.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AI39_CREATOR: CharacterSetCreator;
|
|
12
|
+
//# sourceMappingURL=character-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"character-set.d.ts","sourceRoot":"","sources":["../src/character-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAa,MAAM,uBAAuB,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,YAAY,qBASD,CAAC;AAEzB;;;GAGG;AACH,eAAO,MAAM,YAAY,qBAKD,CAAC"}
|
package/dist/check.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the check digit sum for a numeric string as per section 7.9.1 of the {@link https://www.gs1.org/genspecs |
|
|
3
|
+
* GS1 General Specifications}.
|
|
4
|
+
*
|
|
5
|
+
* @param exchangeWeights
|
|
6
|
+
* If true, start the weights at 1 instead of 3 on the right.
|
|
7
|
+
*
|
|
8
|
+
* @param s
|
|
9
|
+
* Numeric string.
|
|
10
|
+
*
|
|
11
|
+
* @returns
|
|
12
|
+
* Accumulated sum of each digit multiplied by the weight at its position.
|
|
13
|
+
*/
|
|
14
|
+
export declare function checkDigitSum(exchangeWeights: boolean, s: string): number;
|
|
15
|
+
/**
|
|
16
|
+
* Calculate the check digit for a numeric string as per section 7.9.1 of the {@link https://www.gs1.org/genspecs | GS1
|
|
17
|
+
* General Specifications}.
|
|
18
|
+
*
|
|
19
|
+
* @param s
|
|
20
|
+
* Numeric string.
|
|
21
|
+
*
|
|
22
|
+
* @returns
|
|
23
|
+
* Check digit 0-9 as a string.
|
|
24
|
+
*/
|
|
25
|
+
export declare function checkDigit(s: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Determine if a numeric string has a valid check digit.
|
|
28
|
+
*
|
|
29
|
+
* @param s
|
|
30
|
+
* Numeric string with check digit.
|
|
31
|
+
*
|
|
32
|
+
* @returns
|
|
33
|
+
* True if the check digit is valid.
|
|
34
|
+
*/
|
|
35
|
+
export declare function hasValidCheckDigit(s: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Calculate the price/weight check digit for a four-digit numeric string as per section 7.9.3 of the {@link
|
|
38
|
+
* https://www.gs1.org/genspecs | GS1 General Specifications}.
|
|
39
|
+
*
|
|
40
|
+
* @param s
|
|
41
|
+
* Numeric string exactly four characters long.
|
|
42
|
+
*
|
|
43
|
+
* @returns
|
|
44
|
+
* Check digit 0-9 as a string.
|
|
45
|
+
*/
|
|
46
|
+
export declare function fourDigitPriceWeightCheckDigit(s: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Calculate the price/weight check digit for a five-digit numeric string as per section 7.9.3 of the {@link
|
|
49
|
+
* https://www.gs1.org/genspecs | GS1 General Specifications}.
|
|
50
|
+
*
|
|
51
|
+
* @param s
|
|
52
|
+
* Numeric string exactly five characters long.
|
|
53
|
+
*
|
|
54
|
+
* @returns
|
|
55
|
+
* Check digit 0-9 as a string.
|
|
56
|
+
*/
|
|
57
|
+
export declare function fiveDigitPriceWeightCheckDigit(s: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* Calculate the check character for a GS1 AI encodable character set 82 string as per section 7.9.5 of the {@link
|
|
60
|
+
* https://www.gs1.org/genspecs | GS1 General Specifications}.
|
|
61
|
+
*
|
|
62
|
+
* @param s
|
|
63
|
+
* GS1 AI encodable character set 82 string.
|
|
64
|
+
*
|
|
65
|
+
* @returns
|
|
66
|
+
* Check character pair.
|
|
67
|
+
*/
|
|
68
|
+
export declare function checkCharacterPair(s: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Determine if a GS1 AI encodable character set 82 string has a valid check character pair.
|
|
71
|
+
*
|
|
72
|
+
* @param s
|
|
73
|
+
* GS1 AI encodable character set 82 string with check character pair.
|
|
74
|
+
*
|
|
75
|
+
* @returns
|
|
76
|
+
* True if the check character pair is valid.
|
|
77
|
+
*/
|
|
78
|
+
export declare function hasValidCheckCharacterPair(s: string): boolean;
|
|
79
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,eAAe,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAkBzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAGrD;AAyCD;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhE;AAiBD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CA4BpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAI7D"}
|