@pronto-tools-and-more/custom-js-functions 14.6.0 → 14.8.0

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/main.js CHANGED
@@ -482,6 +482,12 @@
482
482
  };
483
483
  var getPrimaryCategoryProperty = (content, key) => {
484
484
  try {
485
+ if (!content) {
486
+ return "n/a";
487
+ }
488
+ if (Array.isArray(content)) {
489
+ return "n/a";
490
+ }
485
491
  const primaryCategoryId = content.properties["taxonomy.category.primary"];
486
492
  const categories = content.taxonomies.filter(isCategory);
487
493
  let primaryCategory = categories.find(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/custom-js-functions",
3
- "version": "14.6.0",
3
+ "version": "14.8.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "type": "module",
@@ -4,6 +4,12 @@ const isCategory = (taxonomy) => {
4
4
 
5
5
  export const getPrimaryCategoryProperty = (content, key) => {
6
6
  try {
7
+ if (!content) {
8
+ return "n/a";
9
+ }
10
+ if (Array.isArray(content)) {
11
+ return "n/a";
12
+ }
7
13
  const primaryCategoryId = content.properties["taxonomy.category.primary"];
8
14
  const categories = content.taxonomies.filter(isCategory);
9
15
  let primaryCategory = categories.find(