@pronto-tools-and-more/custom-js-functions 10.34.0 → 10.36.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/main.js
CHANGED
@@ -406,7 +406,9 @@
|
|
406
406
|
var Functions_exports = {};
|
407
407
|
__export(Functions_exports, {
|
408
408
|
dateHelper: () => dateHelper,
|
409
|
+
debugId: () => debugId,
|
409
410
|
getReadTime: () => getReadTime,
|
411
|
+
handleMenuItems: () => handleMenuItems,
|
410
412
|
id: () => id
|
411
413
|
});
|
412
414
|
|
@@ -419,17 +421,34 @@
|
|
419
421
|
var import_it = __toESM(require_it(), 1);
|
420
422
|
var dateHelper = import_dayjs.default;
|
421
423
|
|
424
|
+
// src/parts/FunctionDebugId/FunctionDebugId.ts
|
425
|
+
var debugId = (content, ...keys) => {
|
426
|
+
let current = content;
|
427
|
+
for (const key of keys) {
|
428
|
+
console.log({ content, key });
|
429
|
+
current = current?.[key];
|
430
|
+
}
|
431
|
+
return current;
|
432
|
+
};
|
433
|
+
|
422
434
|
// src/parts/FunctionId/FunctionId.ts
|
423
435
|
var id = (content, ...keys) => {
|
424
|
-
console.log({ content });
|
425
436
|
let current = content;
|
426
437
|
for (const key of keys) {
|
427
|
-
console.log({ current, key });
|
428
438
|
current = current?.[key];
|
429
439
|
}
|
430
440
|
return current;
|
431
441
|
};
|
432
442
|
|
443
|
+
// src/parts/HandleMenuItems/HandleMenuItems.ts
|
444
|
+
var handleMenuItems = (items, active) => {
|
445
|
+
const index = items.findIndex((item) => item.id === active);
|
446
|
+
if (index === -1) {
|
447
|
+
return "";
|
448
|
+
}
|
449
|
+
return `highlight-${index}`;
|
450
|
+
};
|
451
|
+
|
433
452
|
// src/parts/ReadTime/ReadTime.ts
|
434
453
|
var getReadTime = (content) => {
|
435
454
|
const parsedSeo = JSON.parse(content?.properties?.purple_seo_meta);
|
package/package.json
CHANGED
@@ -1,3 +1,5 @@
|
|
1
1
|
export * from "../DateHelper/DateHelper.ts";
|
2
|
-
export * from "../
|
2
|
+
export * from "../FunctionDebugId/FunctionDebugId.ts";
|
3
|
+
export * from "../FunctionId/FunctionId.ts";
|
4
|
+
export * from "../HandleMenuItems/HandleMenuItems.ts";
|
3
5
|
export * from "../ReadTime/ReadTime.ts";
|