@pronto-tools-and-more/custom-js-functions 12.38.0 → 12.39.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +3 -0
- package/package.json +1 -1
- package/src/parts/ReadTime/ReadTime.ts +3 -0
package/dist/main.js
CHANGED
@@ -488,6 +488,9 @@
|
|
488
488
|
var getReadTime = (content) => {
|
489
489
|
const parsedSeo = JSON.parse(content?.properties?.purple_seo_meta);
|
490
490
|
const readTime = parsedSeo?.twitter_misc?.["Est. reading time"] || "n/a";
|
491
|
+
if (typeof readTime === "number") {
|
492
|
+
return `${readTime} min`;
|
493
|
+
}
|
491
494
|
return readTime;
|
492
495
|
};
|
493
496
|
|
package/package.json
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
export const getReadTime = (content: any) => {
|
2
2
|
const parsedSeo = JSON.parse(content?.properties?.purple_seo_meta);
|
3
3
|
const readTime = parsedSeo?.twitter_misc?.["Est. reading time"] || "n/a";
|
4
|
+
if (typeof readTime === "number") {
|
5
|
+
return `${readTime} min`;
|
6
|
+
}
|
4
7
|
return readTime;
|
5
8
|
};
|