@cimplify/sdk 0.9.3 → 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/dist/index.js CHANGED
@@ -4262,6 +4262,20 @@ function stripProductPrefix(variantName, productName) {
4262
4262
  const match = rest.match(/^\s*[-–—]\s*(.*)/);
4263
4263
  if (match && match[1].length > 0) return match[1];
4264
4264
  }
4265
+ const lowerProduct = productName.toLowerCase().trim();
4266
+ if (lower.startsWith(lowerProduct)) {
4267
+ const rest = variantName.slice(productName.length);
4268
+ const match = rest.match(/^\s*[-–—]\s*(.*)/);
4269
+ if (match && match[1].length > 0) return match[1];
4270
+ }
4271
+ const lastDash = variantName.lastIndexOf("-");
4272
+ if (lastDash > 0 && lastDash < variantName.length - 1) {
4273
+ const prefix = variantName.slice(0, lastDash).trim();
4274
+ const suffix = variantName.slice(lastDash + 1).trim();
4275
+ if (suffix.length > 0 && prefix.length > suffix.length * 2) {
4276
+ return suffix;
4277
+ }
4278
+ }
4265
4279
  return variantName;
4266
4280
  }
4267
4281
  function getVariantDisplayName(variant, productName) {
package/dist/index.mjs CHANGED
@@ -4260,6 +4260,20 @@ function stripProductPrefix(variantName, productName) {
4260
4260
  const match = rest.match(/^\s*[-–—]\s*(.*)/);
4261
4261
  if (match && match[1].length > 0) return match[1];
4262
4262
  }
4263
+ const lowerProduct = productName.toLowerCase().trim();
4264
+ if (lower.startsWith(lowerProduct)) {
4265
+ const rest = variantName.slice(productName.length);
4266
+ const match = rest.match(/^\s*[-–—]\s*(.*)/);
4267
+ if (match && match[1].length > 0) return match[1];
4268
+ }
4269
+ const lastDash = variantName.lastIndexOf("-");
4270
+ if (lastDash > 0 && lastDash < variantName.length - 1) {
4271
+ const prefix = variantName.slice(0, lastDash).trim();
4272
+ const suffix = variantName.slice(lastDash + 1).trim();
4273
+ if (suffix.length > 0 && prefix.length > suffix.length * 2) {
4274
+ return suffix;
4275
+ }
4276
+ }
4263
4277
  return variantName;
4264
4278
  }
4265
4279
  function getVariantDisplayName(variant, productName) {
package/dist/react.js CHANGED
@@ -6809,6 +6809,20 @@ function stripProductPrefix(variantName, productName) {
6809
6809
  const match = rest.match(/^\s*[-–—]\s*(.*)/);
6810
6810
  if (match && match[1].length > 0) return match[1];
6811
6811
  }
6812
+ const lowerProduct = productName.toLowerCase().trim();
6813
+ if (lower.startsWith(lowerProduct)) {
6814
+ const rest = variantName.slice(productName.length);
6815
+ const match = rest.match(/^\s*[-–—]\s*(.*)/);
6816
+ if (match && match[1].length > 0) return match[1];
6817
+ }
6818
+ const lastDash = variantName.lastIndexOf("-");
6819
+ if (lastDash > 0 && lastDash < variantName.length - 1) {
6820
+ const prefix = variantName.slice(0, lastDash).trim();
6821
+ const suffix = variantName.slice(lastDash + 1).trim();
6822
+ if (suffix.length > 0 && prefix.length > suffix.length * 2) {
6823
+ return suffix;
6824
+ }
6825
+ }
6812
6826
  return variantName;
6813
6827
  }
6814
6828
  function getVariantDisplayName(variant, productName) {
package/dist/react.mjs CHANGED
@@ -6803,6 +6803,20 @@ function stripProductPrefix(variantName, productName) {
6803
6803
  const match = rest.match(/^\s*[-–—]\s*(.*)/);
6804
6804
  if (match && match[1].length > 0) return match[1];
6805
6805
  }
6806
+ const lowerProduct = productName.toLowerCase().trim();
6807
+ if (lower.startsWith(lowerProduct)) {
6808
+ const rest = variantName.slice(productName.length);
6809
+ const match = rest.match(/^\s*[-–—]\s*(.*)/);
6810
+ if (match && match[1].length > 0) return match[1];
6811
+ }
6812
+ const lastDash = variantName.lastIndexOf("-");
6813
+ if (lastDash > 0 && lastDash < variantName.length - 1) {
6814
+ const prefix = variantName.slice(0, lastDash).trim();
6815
+ const suffix = variantName.slice(lastDash + 1).trim();
6816
+ if (suffix.length > 0 && prefix.length > suffix.length * 2) {
6817
+ return suffix;
6818
+ }
6819
+ }
6806
6820
  return variantName;
6807
6821
  }
6808
6822
  function getVariantDisplayName(variant, productName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",