@aidc-toolkit/gs1 0.9.2 → 0.9.4

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/eslint.config.js CHANGED
@@ -1,13 +1,3 @@
1
- import tseslint from "typescript-eslint";
2
- import stylistic from "@stylistic/eslint-plugin";
3
- import jsdoc from "eslint-plugin-jsdoc";
4
- import esLintConfigLove from "eslint-config-love";
5
1
  import { esLintConfigAIDCToolkit } from "@aidc-toolkit/dev";
6
2
 
7
- export default tseslint.config(
8
- ...tseslint.configs.strictTypeChecked,
9
- stylistic.configs["recommended-flat"],
10
- jsdoc.configs["flat/recommended-typescript"],
11
- esLintConfigLove,
12
- ...esLintConfigAIDCToolkit
13
- );
3
+ export default esLintConfigAIDCToolkit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/gs1",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "GS1 AIDC Toolkit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,23 +21,20 @@
21
21
  "scripts": {
22
22
  "eslint": "eslint .",
23
23
  "build": "tsup src/index.ts --clean --format cjs,esm --dts",
24
- "build-dev": "npm run build && tsc src/index.ts --outDir dist --target esnext --moduleResolution nodenext --module nodenext --emitDeclarationOnly --declaration --declarationMap",
24
+ "build-doc": "npm run build && tsc src/index.ts --outDir dist --target esnext --moduleResolution nodenext --module nodenext --emitDeclarationOnly --declaration --declarationMap",
25
25
  "test": "vitest run"
26
26
  },
27
27
  "devDependencies": {
28
- "@aidc-toolkit/dev": "^0.9.2",
29
- "@stylistic/eslint-plugin": "^2.10.1",
30
- "eslint-config-love": "^98.0.2",
31
- "eslint-plugin-jsdoc": "^50.5.0",
28
+ "@aidc-toolkit/dev": "^0.9.4",
29
+ "eslint": "^9.15.0",
32
30
  "ts-node": "^10.9.2",
33
31
  "tsup": "^8.3.5",
34
32
  "typescript": "^5.6.3",
35
- "typescript-eslint": "^8.14.0",
36
- "vitest": "^2.1.4"
33
+ "vitest": "^2.1.5"
37
34
  },
38
35
  "dependencies": {
39
- "@aidc-toolkit/core": "^0.9.2",
40
- "@aidc-toolkit/utility": "^0.9.2",
36
+ "@aidc-toolkit/core": "^0.9.4",
37
+ "@aidc-toolkit/utility": "^0.9.4",
41
38
  "i18next": "^23.16.5",
42
39
  "ts-mixer": "^6.0.4"
43
40
  }
package/src/idkey.ts CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  CharacterSetCreator,
3
3
  type CharacterSetValidation,
4
4
  type CharacterSetValidator,
5
- Exclusion,
5
+ Exclusion, IteratorProxy,
6
6
  NUMERIC_CREATOR,
7
7
  RegExpValidator,
8
8
  type StringValidation,
@@ -1612,7 +1612,7 @@ export class SerializableNumericIdentificationKeyCreator extends Mixin(Serializa
1612
1612
 
1613
1613
  result = baseIdentificationKey + serialComponent;
1614
1614
  } else {
1615
- result = Iterator.from(serialComponent).map(serialComponent => this.concatenateValidated(baseIdentificationKey, serialComponent));
1615
+ result = IteratorProxy.from(serialComponent).map(serialComponent => this.concatenateValidated(baseIdentificationKey, serialComponent));
1616
1616
  }
1617
1617
 
1618
1618
  return result;
@@ -1771,7 +1771,7 @@ export class NonNumericIdentificationKeyCreator extends Mixin(NonNumericIdentifi
1771
1771
 
1772
1772
  result = this.requiresCheckCharacterPair ? partialIdentificationKey + checkCharacterPair(partialIdentificationKey) : partialIdentificationKey;
1773
1773
  } else {
1774
- result = Iterator.from(referenceOrReferences).map(reference => this.create(reference));
1774
+ result = IteratorProxy.from(referenceOrReferences).map(reference => this.create(reference));
1775
1775
  }
1776
1776
 
1777
1777
  return result;
@@ -0,0 +1,34 @@
1
+ export const localeStrings = {
2
+ Check: {
3
+ lengthOfStringForCheckCharacterPairMustBeLessThanOrEqualTo: "La longueur {{length}} de la chaîne pour la paire de caractères de vérification doit être inférieure ou égale à {{maximum Length}}"
4
+ },
5
+ IdentificationKey: {
6
+ identificationKeyTypeLength: "{{identificationKeyType}} doit comporter {{length}} chiffres",
7
+ invalidCheckDigit: "Chiffre de contrôle non valide",
8
+ invalidGTINLength: "Le GTIN doit comporter 13, 12, 8 ou 14 chiffres",
9
+ invalidGTIN14Length: "Le GTIN doit comporter 14 chiffres",
10
+ invalidZeroSuppressedGTIN12: "Code GTIN-12 non valide avec zéro supprimé",
11
+ invalidZeroSuppressibleGTIN12: "Le GTIN-12 ne peut pas être supprimé par zéro",
12
+ invalidZeroSuppressedGTIN12AsGTIN13: "GTIN-12 non valide avec zéro supprimé en tant que GTIN-13",
13
+ invalidZeroSuppressedGTIN12AsGTIN14: "GTIN-12 non valide avec zéro supprimé en tant que GTIN-14",
14
+ invalidGTIN13AtRetail: "Le GTIN-13 au niveau des articles de consommation au détail ne peut pas commencer par zéro",
15
+ invalidGTINAtRetail: "Le GTIN n'est pas pris en charge au niveau des articles de consommation au détail",
16
+ invalidGTINAtOtherThanRetail: "Le GTIN n'est pas pris en charge à d'autres niveaux que ceux des articles de consommation au détail",
17
+ indicatorDigit: "chiffre indicateur",
18
+ serialComponent: "composant série",
19
+ reference: "référence",
20
+ referenceCantBeAllNumeric: "La référence ne peut pas être entièrement numérique",
21
+ invalidCheckCharacterPair: "Paire de caractères de contrôle non valide"
22
+ },
23
+ Prefix: {
24
+ gs1CompanyPrefix: "Préfixe de l'entreprise GS1",
25
+ upcCompanyPrefix: "Préfixe de l'entreprise U.P.C.",
26
+ gs18Prefix: "Préfixe GS1-8",
27
+ gs1CompanyPrefixCantStartWith0: "Le préfixe de l'entreprise GS1 ne peut pas commencer par \"0\"",
28
+ gs1CompanyPrefixCantStartWith00000: "Le préfixe de l'entreprise GS1 ne peut pas commencer par \"00000\"",
29
+ gs1CompanyPrefixCantStartWith000000: "Le préfixe de l'entreprise GS1 ne peut pas commencer par \"000000\"",
30
+ upcCompanyPrefixCantStartWith0000: "Le préfixe de l'entreprise U.P.C. ne peut pas commencer par \"0000\"",
31
+ gs18PrefixCantStartWith0: "Le préfixe GS1-8 ne peut pas commencer par \"0\"",
32
+ identificationKeyTypeNotSupportedByGS18Prefix: "{{identificationKeyType}} non pris en charge par le préfixe GS1-8"
33
+ }
34
+ } as const;
@@ -1,8 +1,12 @@
1
- import { i18nAddResourceBundle, i18next } from "@aidc-toolkit/core";
1
+ import { i18nAddResourceBundle, i18nAssertValidResources, i18next } from "@aidc-toolkit/core";
2
2
  import { localeStrings as enLocaleStrings } from "./en/locale_strings.js";
3
+ import { localeStrings as frLocaleStrings } from "./fr/locale_strings.js";
3
4
 
4
5
  export const gs1NS = "aidct_gs1";
5
6
 
7
+ i18nAssertValidResources(enLocaleStrings, "fr", frLocaleStrings);
8
+
6
9
  i18nAddResourceBundle("en", gs1NS, enLocaleStrings);
10
+ i18nAddResourceBundle("fr", gs1NS, frLocaleStrings);
7
11
 
8
12
  export default i18next;
@@ -17,7 +17,8 @@ import {
17
17
  GSRN_VALIDATOR,
18
18
  GTIN12_VALIDATOR,
19
19
  GTIN13_VALIDATOR,
20
- GTIN8_VALIDATOR, GTIN_VALIDATORS,
20
+ GTIN8_VALIDATOR,
21
+ GTIN_VALIDATORS,
21
22
  GTINCreator,
22
23
  GTINLevel,
23
24
  GTINType,