pim-import 6.1.6 → 6.1.8

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.
@@ -847,7 +847,7 @@ const setProductRelationships = async (code, fieldKey = null) => {
847
847
  for (const currentFieldKey of currentFieldKeys) {
848
848
  (0, logs_1.log)(`Set ${currentFieldKey} relations to product with code ${code}`);
849
849
  const fieldValues = productDetails[(0, exports.pimKeyRenamedCheck)(currentFieldKey)];
850
- if (fieldValues) {
850
+ if (fieldValues?.length) {
851
851
  const relationships = [];
852
852
  const productRelationCodes = fieldValues.map((fieldValue) => {
853
853
  return fieldValue.code;
@@ -1559,12 +1559,12 @@ const generateTechSpecPdf = async (topicProductId, country = "global", locale =
1559
1559
  }
1560
1560
  baseUrl = baseUrl.replace(/\/?(\?|#|$)/, "/$1");
1561
1561
  let footerBaseUrl = country === "cn"
1562
- ? process.env.FPI_TECH_SPEC_FOOTER_BASE_URL_CN ??
1562
+ ? (process.env.FPI_TECH_SPEC_FOOTER_BASE_URL_CN ??
1563
1563
  process.env.FPI_TECH_SPEC_BASE_URL_CN ??
1564
- ""
1565
- : process.env.FPI_TECH_SPEC_FOOTER_BASE_URL ??
1564
+ "")
1565
+ : (process.env.FPI_TECH_SPEC_FOOTER_BASE_URL ??
1566
1566
  process.env.FPI_TECH_SPEC_BASE_URL ??
1567
- "";
1567
+ "");
1568
1568
  if (!footerBaseUrl) {
1569
1569
  (0, logs_1.log)(`FPI_TECH_SPEC_FOOTER_BASE_URL process env not found for country ${country}`, "ERROR");
1570
1570
  }
@@ -1776,10 +1776,12 @@ const getTopicProductAutodescription = async (topicProductFields) => {
1776
1776
  autoDescription = topicProductFields?.description;
1777
1777
  break;
1778
1778
  case "PLINE1":
1779
- autoDescription = await getLightModuleAutoDescriptionByProductFields(productFileds);
1779
+ autoDescription =
1780
+ await getLightModuleAutoDescriptionByProductFields(productFileds);
1780
1781
  break;
1781
1782
  default:
1782
- autoDescription = await getOtherAutoDescriptionByProductFields(productFileds);
1783
+ autoDescription =
1784
+ await getOtherAutoDescriptionByProductFields(productFileds);
1783
1785
  break;
1784
1786
  }
1785
1787
  return autoDescription;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pim-import",
3
- "version": "6.1.6",
3
+ "version": "6.1.8",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",