@softwear/latestcollectioncore 1.0.71 → 1.0.72

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.
@@ -17,6 +17,7 @@ const mappingPairs = [
17
17
  { category: 'CustomSize', from: 'sizeSupplier', to: '_customsize' },
18
18
  { category: 'Size', from: 'sizeSupplier', to: 'size' },
19
19
  { category: 'Gender', from: 'articleGroupSupplier', to: '_gender', mustMatch: true },
20
+ { category: 'GenderSupplier', from: 'genderSupplier', to: '_gender', mustMatch: true },
20
21
  { category: 'ERM', from: ['_gender', 'articleGroup'], to: '_erm-code', mustMatch: true, defaultMappingSource: 'ermmapping' },
21
22
  ];
22
23
  const evaluateFromExpr = function (sku, from) {
package/dist/consts.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare const MAPPING_CATEGORIES: readonly ["BTEGroup", "Collection", "ColorCode", "ColorDescription", "CustomSize", "DTBGroup", "ERM", "Gender", "FedasGroup", "ProductGroup", "Size", "SubSize"];
1
+ declare const MAPPING_CATEGORIES: readonly ["BTEGroup", "Collection", "ColorCode", "ColorDescription", "CustomSize", "DTBGroup", "ERM", "Gender", "GenderSupplier", "FedasGroup", "ProductGroup", "Size", "SubSize"];
2
2
  declare const SUBSCRIPTION_LIMITS: {
3
3
  readonly data_only: {
4
4
  readonly maxBarcodes: 1000;
package/dist/consts.js CHANGED
@@ -10,6 +10,7 @@ const MAPPING_CATEGORIES = [
10
10
  'DTBGroup',
11
11
  'ERM',
12
12
  'Gender',
13
+ 'GenderSupplier',
13
14
  'FedasGroup',
14
15
  'ProductGroup',
15
16
  'Size',
package/dist/types.d.ts CHANGED
@@ -136,6 +136,7 @@ interface SkuI {
136
136
  gln?: string;
137
137
  set?: string;
138
138
  erpSource?: string;
139
+ genderSupplier?: string;
139
140
  }
140
141
  interface MarkedSkuI extends SkuI {
141
142
  SOURCE?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,6 +16,7 @@ const mappingPairs = [
16
16
  { category: 'CustomSize', from: 'sizeSupplier', to: '_customsize' },
17
17
  { category: 'Size', from: 'sizeSupplier', to: 'size' },
18
18
  { category: 'Gender', from: 'articleGroupSupplier', to: '_gender', mustMatch: true },
19
+ { category: 'GenderSupplier', from: 'genderSupplier', to: '_gender', mustMatch: true },
19
20
  { category: 'ERM', from: ['_gender', 'articleGroup'], to: '_erm-code', mustMatch: true, defaultMappingSource: 'ermmapping' },
20
21
  ]
21
22
 
package/src/consts.ts CHANGED
@@ -7,6 +7,7 @@ const MAPPING_CATEGORIES = [
7
7
  'DTBGroup',
8
8
  'ERM',
9
9
  'Gender',
10
+ 'GenderSupplier',
10
11
  'FedasGroup',
11
12
  'ProductGroup',
12
13
  'Size',
package/src/types.ts CHANGED
@@ -145,6 +145,7 @@ interface SkuI {
145
145
  gln?: string
146
146
  set?: string
147
147
  erpSource?: string
148
+ genderSupplier?: string
148
149
  }
149
150
 
150
151
  interface MarkedSkuI extends SkuI {
@@ -1,15 +1,17 @@
1
- const { ean13 } = require("../dist/index")
2
- const { expect } = require("chai")
1
+ const { ean13 } = require('../dist/index')
2
+ const { expect } = require('chai')
3
3
 
4
- const should = require("chai").should()
4
+ const should = require('chai').should()
5
5
 
6
- describe("ean13 function", function () {
7
- it("should fail validation for anything shorter than 12 digits", function () {
6
+ describe('ean13 function', function () {
7
+ it('should fail validation for anything shorter than 12 digits', function () {
8
8
  should.throw(() => {
9
- ean13("123")
9
+ ean13('123')
10
10
  })
11
11
  })
12
- it("should calculate a valid check digit", function () {
13
- expect(ean13("123456789012")).to.equal(1234567890128)
12
+ it('should calculate a valid check digit', function () {
13
+ expect(ean13('123456789012')).to.equal(1234567890128)
14
+ expect(ean13('201480005032')).to.equal(2014800050323)
15
+ expect(ean13('201480000006')).to.equal(2014800000069)
14
16
  })
15
17
  })
@@ -14,4 +14,7 @@ describe('sizeToMap function', function () {
14
14
  it('should return the input as uppercase', function () {
15
15
  expect(sizeToMap('xxl')).to.equal('XXL')
16
16
  })
17
+ it('should return input when no change needed', function () {
18
+ expect(sizeToMap('33/34')).to.equal('33/34')
19
+ })
17
20
  })