@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.
- package/dist/buildPropertyMappingFn.js +1 -0
- package/dist/consts.d.ts +1 -1
- package/dist/consts.js +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/buildPropertyMappingFn.ts +1 -0
- package/src/consts.ts +1 -0
- package/src/types.ts +1 -0
- package/test/ean13.spec.js +10 -8
- package/test/{sizeToMap.js → sizeToMap.spec.js} +3 -0
|
@@ -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
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -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
package/src/types.ts
CHANGED
package/test/ean13.spec.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
const { ean13 } = require(
|
|
2
|
-
const { expect } = require(
|
|
1
|
+
const { ean13 } = require('../dist/index')
|
|
2
|
+
const { expect } = require('chai')
|
|
3
3
|
|
|
4
|
-
const should = require(
|
|
4
|
+
const should = require('chai').should()
|
|
5
5
|
|
|
6
|
-
describe(
|
|
7
|
-
it(
|
|
6
|
+
describe('ean13 function', function () {
|
|
7
|
+
it('should fail validation for anything shorter than 12 digits', function () {
|
|
8
8
|
should.throw(() => {
|
|
9
|
-
ean13(
|
|
9
|
+
ean13('123')
|
|
10
10
|
})
|
|
11
11
|
})
|
|
12
|
-
it(
|
|
13
|
-
expect(ean13(
|
|
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
|
})
|