rerobe-js-orm 3.0.17 → 3.0.18

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.
@@ -24,5 +24,6 @@ export default class ReRobeProductHelpers {
24
24
  static getSubtitle(title: string): string;
25
25
  static sizeFinder(sizeLabel: string, sizeToMatch: string): boolean;
26
26
  static convertReRobeSizeToStandardSize(productObj: CompleteProduct): string;
27
+ static mapToOldSizesToStandardSize(productObj: CompleteProduct): string;
27
28
  static buildLineItem(productObj: CompleteProduct, quantity?: number): ProductLineItem;
28
29
  }
@@ -453,6 +453,15 @@ class ReRobeProductHelpers {
453
453
  }
454
454
  return size;
455
455
  }
456
+ static mapToOldSizesToStandardSize(productObj) {
457
+ const { clothingSize = [], jeanSize = '', shoeSize = '' } = productObj;
458
+ const validSizes = clothingSize.filter((size) => typeof size === 'string' && size);
459
+ if (jeanSize)
460
+ validSizes.push(jeanSize);
461
+ if (shoeSize)
462
+ validSizes.push(shoeSize);
463
+ return validSizes.join(' ').trim() || '';
464
+ }
456
465
  // RibbnProductHelper candidate
457
466
  static buildLineItem(productObj, quantity = 1) {
458
467
  const { documentId, title, price, coverPhotoUrl, imageUrls, brand } = productObj;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.0.17",
3
+ "version": "3.0.18",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",