@pronto-tools-and-more/custom-js-functions 13.12.0 → 13.14.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
@@ -414,6 +414,7 @@
414
414
  getReadTime: () => getReadTime,
415
415
  handleMenuItems: () => handleMenuItems,
416
416
  id: () => id,
417
+ idOrUndefined: () => idOrUndefined,
417
418
  parse: () => parse
418
419
  });
419
420
 
@@ -466,6 +467,15 @@
466
467
  return current || "";
467
468
  };
468
469
 
470
+ // src/parts/FunctionIdOrUndefined/FunctionIdOrUndefined.ts
471
+ var idOrUndefined = (content, ...keys) => {
472
+ let current = content;
473
+ for (const key of keys) {
474
+ current = current?.[key];
475
+ }
476
+ return current || "";
477
+ };
478
+
469
479
  // src/parts/GetCategoryProperty/GetCategoryProperty.ts
470
480
  var isCategory = (taxonomy) => {
471
481
  return taxonomy.type === "category";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/custom-js-functions",
3
- "version": "13.12.0",
3
+ "version": "13.14.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "type": "module",
@@ -0,0 +1,7 @@
1
+ export const idOrUndefined = (content, ...keys) => {
2
+ let current = content;
3
+ for (const key of keys) {
4
+ current = current?.[key];
5
+ }
6
+ return current || "";
7
+ };
@@ -4,6 +4,7 @@ export * from "../DateHelper/DateHelper.ts";
4
4
  export * from "../FunctionBookmarkIdString/FunctionBookmarkIdString.ts";
5
5
  export * from "../FunctionDebugId/FunctionDebugId.ts";
6
6
  export * from "../FunctionId/FunctionId.ts";
7
+ export * from "../FunctionIdOrUndefined/FunctionIdOrUndefined.ts";
7
8
  export * from "../GetCategoryProperty/GetCategoryProperty.ts";
8
9
  export * from "../HandleMenuItems/HandleMenuItems.ts";
9
10
  export * from "../Parse/Parse.ts";