@pronto-tools-and-more/custom-js-functions 10.15.1 → 10.16.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/main.js
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
// src/parts/Functions/Functions.ts
|
10
10
|
var Functions_exports = {};
|
11
11
|
__export(Functions_exports, {
|
12
|
-
fixRender: () => fixRender,
|
13
12
|
getReadTime: () => getReadTime,
|
14
13
|
id: () => id
|
15
14
|
});
|
@@ -25,6 +24,19 @@
|
|
25
24
|
return current;
|
26
25
|
};
|
27
26
|
|
27
|
+
// src/parts/ReadTime/ReadTime.ts
|
28
|
+
var getReadTime = (content) => {
|
29
|
+
const parsedSeo = JSON.parse(content?.properties?.purple_seo_meta);
|
30
|
+
const readTime = parsedSeo?.twitter_misc?.["Est. reading time"] || "n/a";
|
31
|
+
return readTime;
|
32
|
+
};
|
33
|
+
|
34
|
+
// src/parts/Globals/Globals.ts
|
35
|
+
var Globals_exports = {};
|
36
|
+
__export(Globals_exports, {
|
37
|
+
fixRender: () => fixRender
|
38
|
+
});
|
39
|
+
|
28
40
|
// src/parts/FixRender/FixRender.ts
|
29
41
|
var fixRender = (that) => {
|
30
42
|
const root = that.parentNode.parentNode.parentNode.parentNode.parentNode;
|
@@ -50,20 +62,16 @@
|
|
50
62
|
root.replaceWith(realNodes[0]);
|
51
63
|
};
|
52
64
|
|
53
|
-
// src/parts/ReadTime/ReadTime.ts
|
54
|
-
var getReadTime = (content) => {
|
55
|
-
const parsedSeo = JSON.parse(content?.properties?.purple_seo_meta);
|
56
|
-
const readTime = parsedSeo?.twitter_misc?.["Est. reading time"] || "n/a";
|
57
|
-
return readTime;
|
58
|
-
};
|
59
|
-
|
60
65
|
// src/parts/Main/Main.ts
|
61
66
|
var main = () => {
|
62
67
|
const ref = window.$functions || {};
|
63
68
|
for (const [key, value] of Object.entries(Functions_exports)) {
|
64
|
-
console.log({ key, value });
|
65
69
|
ref[key] ||= value;
|
66
70
|
}
|
71
|
+
const globalRef = globalThis;
|
72
|
+
for (const [key, value] of Object.entries(Globals_exports)) {
|
73
|
+
globalRef[key] ||= value;
|
74
|
+
}
|
67
75
|
};
|
68
76
|
|
69
77
|
// src/main.ts
|
package/package.json
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export * from "../FixRender/FixRender.ts";
|
package/src/parts/Main/Main.ts
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
import * as Functions from "../Functions/Functions.js";
|
2
|
+
import * as Globals from "../Globals/Globals.js";
|
2
3
|
|
3
4
|
export const main = () => {
|
4
5
|
// @ts-ignore
|
5
6
|
const ref = window.$functions || {};
|
6
7
|
for (const [key, value] of Object.entries(Functions)) {
|
7
|
-
console.log({ key, value });
|
8
8
|
ref[key] ||= value;
|
9
9
|
}
|
10
|
+
const globalRef = globalThis;
|
11
|
+
for (const [key, value] of Object.entries(Globals)) {
|
12
|
+
globalRef[key] ||= value;
|
13
|
+
}
|
10
14
|
};
|