feedsmith 3.0.0-next.6 → 3.0.0-rc.1
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/README.md +1 -1
- package/dist/common/config.cjs +103 -274
- package/dist/common/config.js +102 -273
- package/dist/common/errors.cjs +30 -0
- package/dist/common/errors.d.cts +15 -0
- package/dist/common/errors.d.ts +15 -0
- package/dist/common/errors.js +27 -0
- package/dist/common/parse.cjs +13 -14
- package/dist/common/parse.d.cts +15 -14
- package/dist/common/parse.d.ts +15 -14
- package/dist/common/parse.js +4 -5
- package/dist/common/types.d.cts +1 -1
- package/dist/common/types.d.ts +1 -1
- package/dist/common/utils.cjs +142 -73
- package/dist/common/utils.js +123 -57
- package/dist/feeds/atom/common/types.d.cts +2 -2
- package/dist/feeds/atom/common/types.d.ts +2 -2
- package/dist/feeds/atom/detect/index.cjs +8 -8
- package/dist/feeds/atom/detect/index.js +6 -6
- package/dist/feeds/atom/generate/config.cjs +3 -6
- package/dist/feeds/atom/generate/config.js +1 -3
- package/dist/feeds/atom/generate/index.cjs +7 -8
- package/dist/feeds/atom/generate/index.d.cts +2 -2
- package/dist/feeds/atom/generate/index.d.ts +2 -2
- package/dist/feeds/atom/generate/index.js +3 -4
- package/dist/feeds/atom/generate/utils.cjs +43 -36
- package/dist/feeds/atom/generate/utils.js +12 -13
- package/dist/feeds/atom/parse/config.cjs +12 -5
- package/dist/feeds/atom/parse/config.js +10 -5
- package/dist/feeds/atom/parse/index.cjs +15 -11
- package/dist/feeds/atom/parse/index.d.cts +2 -2
- package/dist/feeds/atom/parse/index.d.ts +2 -2
- package/dist/feeds/atom/parse/index.js +13 -9
- package/dist/feeds/atom/parse/utils.cjs +54 -42
- package/dist/feeds/atom/parse/utils.js +17 -18
- package/dist/feeds/json/common/types.d.cts +2 -2
- package/dist/feeds/json/common/types.d.ts +2 -2
- package/dist/feeds/json/detect/index.cjs +7 -8
- package/dist/feeds/json/detect/index.js +4 -5
- package/dist/feeds/json/generate/index.cjs +7 -5
- package/dist/feeds/json/generate/index.d.cts +2 -2
- package/dist/feeds/json/generate/index.d.ts +2 -2
- package/dist/feeds/json/generate/index.js +6 -4
- package/dist/feeds/json/generate/utils.cjs +11 -6
- package/dist/feeds/json/generate/utils.js +9 -5
- package/dist/feeds/json/parse/index.cjs +8 -9
- package/dist/feeds/json/parse/index.d.cts +2 -2
- package/dist/feeds/json/parse/index.d.ts +2 -2
- package/dist/feeds/json/parse/index.js +4 -5
- package/dist/feeds/json/parse/utils.cjs +43 -39
- package/dist/feeds/json/parse/utils.js +38 -39
- package/dist/feeds/rdf/common/types.d.cts +2 -2
- package/dist/feeds/rdf/common/types.d.ts +2 -2
- package/dist/feeds/rdf/detect/index.cjs +8 -8
- package/dist/feeds/rdf/detect/index.js +6 -6
- package/dist/feeds/rdf/parse/config.cjs +12 -4
- package/dist/feeds/rdf/parse/config.js +10 -4
- package/dist/feeds/rdf/parse/index.cjs +15 -11
- package/dist/feeds/rdf/parse/index.d.cts +2 -2
- package/dist/feeds/rdf/parse/index.d.ts +2 -2
- package/dist/feeds/rdf/parse/index.js +13 -9
- package/dist/feeds/rdf/parse/utils.cjs +28 -22
- package/dist/feeds/rdf/parse/utils.js +9 -10
- package/dist/feeds/rss/common/types.d.cts +11 -12
- package/dist/feeds/rss/common/types.d.ts +11 -12
- package/dist/feeds/rss/detect/index.cjs +9 -8
- package/dist/feeds/rss/detect/index.js +8 -7
- package/dist/feeds/rss/generate/config.cjs +3 -6
- package/dist/feeds/rss/generate/config.js +1 -3
- package/dist/feeds/rss/generate/index.cjs +7 -8
- package/dist/feeds/rss/generate/index.d.cts +2 -2
- package/dist/feeds/rss/generate/index.d.ts +2 -2
- package/dist/feeds/rss/generate/index.js +3 -4
- package/dist/feeds/rss/generate/utils.cjs +58 -51
- package/dist/feeds/rss/generate/utils.js +17 -21
- package/dist/feeds/rss/parse/config.cjs +36 -25
- package/dist/feeds/rss/parse/config.js +34 -25
- package/dist/feeds/rss/parse/index.cjs +15 -11
- package/dist/feeds/rss/parse/index.d.cts +2 -2
- package/dist/feeds/rss/parse/index.d.ts +2 -2
- package/dist/feeds/rss/parse/index.js +13 -9
- package/dist/feeds/rss/parse/utils.cjs +164 -43
- package/dist/feeds/rss/parse/utils.js +119 -14
- package/dist/index.cjs +21 -17
- package/dist/index.d.cts +52 -6
- package/dist/index.d.ts +52 -6
- package/dist/index.js +2 -2
- package/dist/namespaces/acast/common/config.cjs +18 -0
- package/dist/namespaces/acast/common/config.js +17 -0
- package/dist/namespaces/acast/generate/utils.cjs +9 -8
- package/dist/namespaces/acast/generate/utils.js +7 -8
- package/dist/namespaces/acast/parse/utils.cjs +9 -8
- package/dist/namespaces/acast/parse/utils.js +7 -8
- package/dist/namespaces/admin/common/config.cjs +11 -0
- package/dist/namespaces/admin/common/config.js +10 -0
- package/dist/namespaces/admin/generate/utils.cjs +4 -5
- package/dist/namespaces/admin/generate/utils.js +4 -5
- package/dist/namespaces/admin/parse/utils.cjs +4 -5
- package/dist/namespaces/admin/parse/utils.js +4 -5
- package/dist/namespaces/app/common/config.cjs +11 -0
- package/dist/namespaces/app/common/config.js +10 -0
- package/dist/namespaces/app/generate/utils.cjs +6 -6
- package/dist/namespaces/app/generate/utils.js +5 -6
- package/dist/namespaces/app/parse/utils.cjs +6 -6
- package/dist/namespaces/app/parse/utils.js +5 -6
- package/dist/namespaces/arxiv/common/config.cjs +16 -0
- package/dist/namespaces/arxiv/common/config.js +15 -0
- package/dist/namespaces/arxiv/generate/utils.cjs +7 -7
- package/dist/namespaces/arxiv/generate/utils.js +6 -7
- package/dist/namespaces/arxiv/parse/utils.cjs +7 -7
- package/dist/namespaces/arxiv/parse/utils.js +6 -7
- package/dist/namespaces/atom/common/config.cjs +11 -0
- package/dist/namespaces/atom/common/config.js +11 -0
- package/dist/namespaces/atom/common/types.d.cts +3 -3
- package/dist/namespaces/atom/common/types.d.ts +3 -3
- package/dist/namespaces/atom/generate/utils.cjs +2 -4
- package/dist/namespaces/atom/generate/utils.js +1 -3
- package/dist/namespaces/atom/parse/utils.cjs +2 -4
- package/dist/namespaces/atom/parse/utils.js +1 -3
- package/dist/namespaces/blogchannel/common/config.cjs +15 -0
- package/dist/namespaces/blogchannel/common/config.js +14 -0
- package/dist/namespaces/blogchannel/generate/utils.cjs +4 -5
- package/dist/namespaces/blogchannel/generate/utils.js +4 -5
- package/dist/namespaces/blogchannel/parse/utils.cjs +4 -5
- package/dist/namespaces/blogchannel/parse/utils.js +4 -5
- package/dist/namespaces/cc/common/config.cjs +25 -0
- package/dist/namespaces/cc/common/config.js +24 -0
- package/dist/namespaces/cc/generate/utils.cjs +4 -5
- package/dist/namespaces/cc/generate/utils.js +4 -5
- package/dist/namespaces/cc/parse/utils.cjs +4 -5
- package/dist/namespaces/cc/parse/utils.js +4 -5
- package/dist/namespaces/content/common/config.cjs +11 -0
- package/dist/namespaces/content/common/config.js +10 -0
- package/dist/namespaces/content/generate/utils.cjs +4 -5
- package/dist/namespaces/content/generate/utils.js +4 -5
- package/dist/namespaces/content/parse/utils.cjs +4 -5
- package/dist/namespaces/content/parse/utils.js +4 -5
- package/dist/namespaces/creativecommons/common/config.cjs +15 -0
- package/dist/namespaces/creativecommons/common/config.js +14 -0
- package/dist/namespaces/creativecommons/generate/utils.cjs +4 -5
- package/dist/namespaces/creativecommons/generate/utils.js +4 -5
- package/dist/namespaces/creativecommons/parse/utils.cjs +4 -5
- package/dist/namespaces/creativecommons/parse/utils.js +4 -5
- package/dist/namespaces/dc/common/config.cjs +35 -0
- package/dist/namespaces/dc/common/config.js +34 -0
- package/dist/namespaces/dc/generate/utils.cjs +4 -5
- package/dist/namespaces/dc/generate/utils.js +4 -5
- package/dist/namespaces/dc/parse/utils.cjs +4 -5
- package/dist/namespaces/dc/parse/utils.js +4 -5
- package/dist/namespaces/dcterms/common/config.cjs +75 -0
- package/dist/namespaces/dcterms/common/config.js +74 -0
- package/dist/namespaces/dcterms/generate/utils.cjs +4 -5
- package/dist/namespaces/dcterms/generate/utils.js +4 -5
- package/dist/namespaces/dcterms/parse/utils.cjs +4 -5
- package/dist/namespaces/dcterms/parse/utils.js +4 -5
- package/dist/namespaces/feedpress/common/config.cjs +25 -0
- package/dist/namespaces/feedpress/common/config.js +24 -0
- package/dist/namespaces/feedpress/generate/utils.cjs +4 -5
- package/dist/namespaces/feedpress/generate/utils.js +4 -5
- package/dist/namespaces/feedpress/parse/utils.cjs +4 -5
- package/dist/namespaces/feedpress/parse/utils.js +4 -5
- package/dist/namespaces/geo/common/config.cjs +10 -0
- package/dist/namespaces/geo/common/config.js +9 -0
- package/dist/namespaces/geo/generate/utils.cjs +4 -5
- package/dist/namespaces/geo/generate/utils.js +4 -5
- package/dist/namespaces/geo/parse/utils.cjs +4 -5
- package/dist/namespaces/geo/parse/utils.js +4 -5
- package/dist/namespaces/georss/common/config.cjs +22 -0
- package/dist/namespaces/georss/common/config.js +21 -0
- package/dist/namespaces/georss/generate/utils.cjs +13 -9
- package/dist/namespaces/georss/generate/utils.js +8 -9
- package/dist/namespaces/georss/parse/utils.cjs +16 -11
- package/dist/namespaces/georss/parse/utils.js +6 -6
- package/dist/namespaces/googleplay/common/config.cjs +22 -0
- package/dist/namespaces/googleplay/common/config.js +21 -0
- package/dist/namespaces/googleplay/generate/utils.cjs +6 -7
- package/dist/namespaces/googleplay/generate/utils.js +6 -7
- package/dist/namespaces/googleplay/parse/utils.cjs +10 -8
- package/dist/namespaces/googleplay/parse/utils.js +7 -8
- package/dist/namespaces/itunes/common/config.cjs +24 -0
- package/dist/namespaces/itunes/common/config.js +23 -0
- package/dist/namespaces/itunes/generate/utils.cjs +11 -9
- package/dist/namespaces/itunes/generate/utils.js +7 -8
- package/dist/namespaces/itunes/parse/utils.cjs +16 -11
- package/dist/namespaces/itunes/parse/utils.js +11 -11
- package/dist/namespaces/media/common/config.cjs +49 -0
- package/dist/namespaces/media/common/config.js +48 -0
- package/dist/namespaces/media/generate/utils.cjs +62 -32
- package/dist/namespaces/media/generate/utils.js +31 -32
- package/dist/namespaces/media/parse/utils.cjs +55 -24
- package/dist/namespaces/media/parse/utils.js +23 -24
- package/dist/namespaces/opensearch/common/config.cjs +17 -0
- package/dist/namespaces/opensearch/common/config.js +16 -0
- package/dist/namespaces/opensearch/generate/utils.cjs +6 -6
- package/dist/namespaces/opensearch/generate/utils.js +5 -6
- package/dist/namespaces/opensearch/parse/utils.cjs +6 -6
- package/dist/namespaces/opensearch/parse/utils.js +5 -6
- package/dist/namespaces/pingback/common/config.cjs +15 -0
- package/dist/namespaces/pingback/common/config.js +14 -0
- package/dist/namespaces/pingback/generate/utils.cjs +5 -6
- package/dist/namespaces/pingback/generate/utils.js +5 -6
- package/dist/namespaces/pingback/parse/utils.cjs +5 -6
- package/dist/namespaces/pingback/parse/utils.js +5 -6
- package/dist/namespaces/podcast/common/config.cjs +28 -0
- package/dist/namespaces/podcast/common/config.js +27 -0
- package/dist/namespaces/podcast/generate/utils.cjs +65 -36
- package/dist/namespaces/podcast/generate/utils.js +35 -36
- package/dist/namespaces/podcast/parse/utils.cjs +60 -28
- package/dist/namespaces/podcast/parse/utils.js +29 -28
- package/dist/namespaces/prism/common/config.cjs +138 -0
- package/dist/namespaces/prism/common/config.js +137 -0
- package/dist/namespaces/prism/generate/utils.cjs +5 -6
- package/dist/namespaces/prism/generate/utils.js +5 -6
- package/dist/namespaces/prism/parse/utils.cjs +5 -6
- package/dist/namespaces/prism/parse/utils.js +5 -6
- package/dist/namespaces/psc/common/config.cjs +9 -0
- package/dist/namespaces/psc/common/config.js +9 -0
- package/dist/namespaces/psc/generate/utils.cjs +7 -6
- package/dist/namespaces/psc/generate/utils.js +5 -6
- package/dist/namespaces/psc/parse/utils.cjs +7 -6
- package/dist/namespaces/psc/parse/utils.js +5 -6
- package/dist/namespaces/rawvoice/common/config.cjs +29 -0
- package/dist/namespaces/rawvoice/common/config.js +28 -0
- package/dist/namespaces/rawvoice/generate/utils.cjs +19 -13
- package/dist/namespaces/rawvoice/generate/utils.js +12 -13
- package/dist/namespaces/rawvoice/parse/utils.cjs +18 -12
- package/dist/namespaces/rawvoice/parse/utils.js +11 -12
- package/dist/namespaces/rdf/common/config.cjs +6 -0
- package/dist/namespaces/rdf/common/config.js +5 -0
- package/dist/namespaces/rdf/parse/utils.cjs +4 -5
- package/dist/namespaces/rdf/parse/utils.js +4 -5
- package/dist/namespaces/rss/common/config.cjs +9 -0
- package/dist/namespaces/rss/common/config.js +9 -0
- package/dist/namespaces/slash/common/config.cjs +16 -0
- package/dist/namespaces/slash/common/config.js +15 -0
- package/dist/namespaces/slash/generate/utils.cjs +4 -5
- package/dist/namespaces/slash/generate/utils.js +4 -5
- package/dist/namespaces/slash/parse/utils.cjs +5 -5
- package/dist/namespaces/slash/parse/utils.js +4 -5
- package/dist/namespaces/source/common/config.cjs +26 -0
- package/dist/namespaces/source/common/config.js +25 -0
- package/dist/namespaces/source/common/types.d.cts +7 -2
- package/dist/namespaces/source/common/types.d.ts +7 -2
- package/dist/namespaces/source/generate/utils.cjs +25 -13
- package/dist/namespaces/source/generate/utils.js +20 -13
- package/dist/namespaces/source/parse/utils.cjs +24 -13
- package/dist/namespaces/source/parse/utils.js +19 -13
- package/dist/namespaces/spotify/common/config.cjs +11 -0
- package/dist/namespaces/spotify/common/config.js +10 -0
- package/dist/namespaces/spotify/generate/utils.cjs +17 -12
- package/dist/namespaces/spotify/generate/utils.js +11 -12
- package/dist/namespaces/spotify/parse/utils.cjs +17 -12
- package/dist/namespaces/spotify/parse/utils.js +11 -12
- package/dist/namespaces/sy/common/config.cjs +15 -0
- package/dist/namespaces/sy/common/config.js +14 -0
- package/dist/namespaces/sy/generate/utils.cjs +4 -5
- package/dist/namespaces/sy/generate/utils.js +4 -5
- package/dist/namespaces/sy/parse/utils.cjs +4 -5
- package/dist/namespaces/sy/parse/utils.js +4 -5
- package/dist/namespaces/thr/common/config.cjs +15 -0
- package/dist/namespaces/thr/common/config.js +14 -0
- package/dist/namespaces/thr/generate/utils.cjs +7 -7
- package/dist/namespaces/thr/generate/utils.js +6 -7
- package/dist/namespaces/thr/parse/utils.cjs +7 -7
- package/dist/namespaces/thr/parse/utils.js +6 -7
- package/dist/namespaces/trackback/common/config.cjs +11 -0
- package/dist/namespaces/trackback/common/config.js +10 -0
- package/dist/namespaces/trackback/generate/utils.cjs +4 -5
- package/dist/namespaces/trackback/generate/utils.js +4 -5
- package/dist/namespaces/trackback/parse/utils.cjs +4 -5
- package/dist/namespaces/trackback/parse/utils.js +4 -5
- package/dist/namespaces/wfw/common/config.cjs +11 -0
- package/dist/namespaces/wfw/common/config.js +10 -0
- package/dist/namespaces/wfw/generate/utils.cjs +4 -5
- package/dist/namespaces/wfw/generate/utils.js +4 -5
- package/dist/namespaces/wfw/parse/utils.cjs +4 -5
- package/dist/namespaces/wfw/parse/utils.js +4 -5
- package/dist/namespaces/xml/generate/utils.cjs +4 -5
- package/dist/namespaces/xml/generate/utils.js +4 -5
- package/dist/namespaces/xml/parse/utils.cjs +4 -5
- package/dist/namespaces/xml/parse/utils.js +4 -5
- package/dist/namespaces/yt/common/config.cjs +15 -0
- package/dist/namespaces/yt/common/config.js +14 -0
- package/dist/namespaces/yt/generate/utils.cjs +5 -6
- package/dist/namespaces/yt/generate/utils.js +5 -6
- package/dist/namespaces/yt/parse/utils.cjs +5 -6
- package/dist/namespaces/yt/parse/utils.js +5 -6
- package/dist/node_modules/trousse/dist/coercions.cjs +25 -0
- package/dist/node_modules/trousse/dist/coercions.js +23 -0
- package/dist/node_modules/trousse/dist/is.cjs +31 -0
- package/dist/node_modules/trousse/dist/is.js +25 -0
- package/dist/opml/generate/config.cjs +3 -6
- package/dist/opml/generate/config.js +1 -3
- package/dist/opml/generate/index.cjs +7 -8
- package/dist/opml/generate/index.js +3 -4
- package/dist/opml/generate/utils.cjs +11 -9
- package/dist/opml/generate/utils.js +7 -8
- package/dist/opml/parse/config.cjs +14 -16
- package/dist/opml/parse/config.js +12 -15
- package/dist/opml/parse/index.cjs +13 -8
- package/dist/opml/parse/index.js +10 -5
- package/dist/opml/parse/utils.cjs +11 -9
- package/dist/opml/parse/utils.js +7 -8
- package/package.json +7 -6
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { isPlainObject } from "../../../node_modules/trousse/dist/is.js";
|
|
2
|
+
import { parseArrayOf, parseBoolean, parseDate, parseNumber, parseSingularOf, parseString, parseYesNoBoolean, retrieveText, trimArray, trimObject } from "../../../common/utils.js";
|
|
3
3
|
//#region src/namespaces/podcast/parse/utils.ts
|
|
4
|
+
const whitespaceRegex = /\s+/;
|
|
5
|
+
const trailingWRegex = /w$/;
|
|
4
6
|
const parseTranscript = (value) => {
|
|
5
|
-
if (!
|
|
7
|
+
if (!isPlainObject(value)) return;
|
|
6
8
|
return trimObject({
|
|
7
9
|
url: parseString(value["@url"]),
|
|
8
10
|
type: parseString(value["@type"]),
|
|
@@ -17,21 +19,21 @@ const parseLocked = (value) => {
|
|
|
17
19
|
});
|
|
18
20
|
};
|
|
19
21
|
const parseFunding = (value) => {
|
|
20
|
-
if (!
|
|
22
|
+
if (!isPlainObject(value)) return;
|
|
21
23
|
return trimObject({
|
|
22
24
|
url: parseString(value["@url"]),
|
|
23
25
|
display: parseString(value["#text"])
|
|
24
26
|
});
|
|
25
27
|
};
|
|
26
28
|
const parseChapters = (value) => {
|
|
27
|
-
if (!
|
|
29
|
+
if (!isPlainObject(value)) return;
|
|
28
30
|
return trimObject({
|
|
29
31
|
url: parseString(value["@url"]),
|
|
30
32
|
type: parseString(value["@type"])
|
|
31
33
|
});
|
|
32
34
|
};
|
|
33
35
|
const parseSoundbite = (value) => {
|
|
34
|
-
if (!
|
|
36
|
+
if (!isPlainObject(value)) return;
|
|
35
37
|
return trimObject({
|
|
36
38
|
startTime: parseNumber(value["@starttime"]),
|
|
37
39
|
duration: parseNumber(value["@duration"]),
|
|
@@ -69,7 +71,7 @@ const parseEpisode = (value) => {
|
|
|
69
71
|
});
|
|
70
72
|
};
|
|
71
73
|
const parseTrailer = (value, options) => {
|
|
72
|
-
if (!
|
|
74
|
+
if (!isPlainObject(value)) return;
|
|
73
75
|
return trimObject({
|
|
74
76
|
display: parseString(retrieveText(value)),
|
|
75
77
|
url: parseString(value["@url"]),
|
|
@@ -86,7 +88,7 @@ const parseLicense = (value) => {
|
|
|
86
88
|
});
|
|
87
89
|
};
|
|
88
90
|
const parseAlternateEnclosure = (value) => {
|
|
89
|
-
if (!
|
|
91
|
+
if (!isPlainObject(value)) return;
|
|
90
92
|
return trimObject({
|
|
91
93
|
type: parseString(value["@type"]),
|
|
92
94
|
length: parseNumber(value["@length"]),
|
|
@@ -102,21 +104,21 @@ const parseAlternateEnclosure = (value) => {
|
|
|
102
104
|
});
|
|
103
105
|
};
|
|
104
106
|
const parseSource = (value) => {
|
|
105
|
-
if (!
|
|
107
|
+
if (!isPlainObject(value)) return;
|
|
106
108
|
return trimObject({
|
|
107
109
|
uri: parseString(value["@uri"]),
|
|
108
110
|
contentType: parseString(value["@contenttype"])
|
|
109
111
|
});
|
|
110
112
|
};
|
|
111
113
|
const parseIntegrity = (value) => {
|
|
112
|
-
if (!
|
|
114
|
+
if (!isPlainObject(value)) return;
|
|
113
115
|
return trimObject({
|
|
114
116
|
type: parseString(value["@type"]),
|
|
115
117
|
value: parseString(value["@value"])
|
|
116
118
|
});
|
|
117
119
|
};
|
|
118
120
|
const parseValue = (value) => {
|
|
119
|
-
if (!
|
|
121
|
+
if (!isPlainObject(value)) return;
|
|
120
122
|
return trimObject({
|
|
121
123
|
type: parseString(value["@type"]),
|
|
122
124
|
method: parseString(value["@method"]),
|
|
@@ -126,7 +128,7 @@ const parseValue = (value) => {
|
|
|
126
128
|
});
|
|
127
129
|
};
|
|
128
130
|
const parseValueRecipient = (value) => {
|
|
129
|
-
if (!
|
|
131
|
+
if (!isPlainObject(value)) return;
|
|
130
132
|
return trimObject({
|
|
131
133
|
name: parseString(value["@name"]),
|
|
132
134
|
customKey: parseString(value["@customkey"]),
|
|
@@ -138,7 +140,7 @@ const parseValueRecipient = (value) => {
|
|
|
138
140
|
});
|
|
139
141
|
};
|
|
140
142
|
const parseImage = (value) => {
|
|
141
|
-
if (!
|
|
143
|
+
if (!isPlainObject(value)) return;
|
|
142
144
|
return trimObject({
|
|
143
145
|
href: parseString(value["@href"]),
|
|
144
146
|
alt: parseString(value["@alt"]),
|
|
@@ -155,10 +157,10 @@ const parseImages = (value) => {
|
|
|
155
157
|
const images = [];
|
|
156
158
|
const segments = srcset.split(",");
|
|
157
159
|
for (const segment of segments) {
|
|
158
|
-
const [href, width] = segment.trim().split(
|
|
160
|
+
const [href, width] = segment.trim().split(whitespaceRegex);
|
|
159
161
|
const image = {
|
|
160
162
|
href: parseString(href),
|
|
161
|
-
width: parseNumber(width?.replace(
|
|
163
|
+
width: parseNumber(width?.replace(trailingWRegex, ""))
|
|
162
164
|
};
|
|
163
165
|
images.push(image);
|
|
164
166
|
}
|
|
@@ -168,7 +170,7 @@ const retrieveImages = (value) => {
|
|
|
168
170
|
return parseArrayOf(value["podcast:image"], parseImage) ?? parseSingularOf(value["podcast:images"], parseImages);
|
|
169
171
|
};
|
|
170
172
|
const parseLiveItem = (value, options) => {
|
|
171
|
-
if (!
|
|
173
|
+
if (!isPlainObject(value)) return;
|
|
172
174
|
return trimObject({
|
|
173
175
|
...retrieveItem(value),
|
|
174
176
|
status: parseString(value["@status"]),
|
|
@@ -178,14 +180,14 @@ const parseLiveItem = (value, options) => {
|
|
|
178
180
|
});
|
|
179
181
|
};
|
|
180
182
|
const parseContentLink = (value) => {
|
|
181
|
-
if (!
|
|
183
|
+
if (!isPlainObject(value)) return;
|
|
182
184
|
return trimObject({
|
|
183
185
|
href: parseString(value["@href"]),
|
|
184
186
|
display: parseString(retrieveText(value))
|
|
185
187
|
});
|
|
186
188
|
};
|
|
187
189
|
const parseSocialInteract = (value) => {
|
|
188
|
-
if (!
|
|
190
|
+
if (!isPlainObject(value)) return;
|
|
189
191
|
return trimObject({
|
|
190
192
|
uri: parseString(value["@uri"]),
|
|
191
193
|
protocol: parseString(value["@protocol"]),
|
|
@@ -195,7 +197,7 @@ const parseSocialInteract = (value) => {
|
|
|
195
197
|
});
|
|
196
198
|
};
|
|
197
199
|
const parseChat = (value) => {
|
|
198
|
-
if (!
|
|
200
|
+
if (!isPlainObject(value)) return;
|
|
199
201
|
return trimObject({
|
|
200
202
|
server: parseString(value["@server"]),
|
|
201
203
|
protocol: parseString(value["@protocol"]),
|
|
@@ -216,7 +218,7 @@ const parseTxt = (value) => {
|
|
|
216
218
|
});
|
|
217
219
|
};
|
|
218
220
|
const parseRemoteItem = (value) => {
|
|
219
|
-
if (!
|
|
221
|
+
if (!isPlainObject(value)) return;
|
|
220
222
|
return trimObject({
|
|
221
223
|
feedGuid: parseString(value["@feedguid"]),
|
|
222
224
|
feedUrl: parseString(value["@feedurl"]),
|
|
@@ -226,7 +228,7 @@ const parseRemoteItem = (value) => {
|
|
|
226
228
|
});
|
|
227
229
|
};
|
|
228
230
|
const parsePodroll = (value) => {
|
|
229
|
-
if (!
|
|
231
|
+
if (!isPlainObject(value)) return;
|
|
230
232
|
return trimObject({ remoteItems: parseArrayOf(value["podcast:remoteitem"], parseRemoteItem) });
|
|
231
233
|
};
|
|
232
234
|
const parseUpdateFrequency = (value, options) => {
|
|
@@ -238,15 +240,15 @@ const parseUpdateFrequency = (value, options) => {
|
|
|
238
240
|
});
|
|
239
241
|
};
|
|
240
242
|
const parsePodping = (value) => {
|
|
241
|
-
if (!
|
|
243
|
+
if (!isPlainObject(value)) return;
|
|
242
244
|
return trimObject({ usesPodping: parseBoolean(value["@usespodping"]) });
|
|
243
245
|
};
|
|
244
246
|
const parsePublisher = (value) => {
|
|
245
|
-
if (!
|
|
247
|
+
if (!isPlainObject(value)) return;
|
|
246
248
|
return trimObject({ remoteItem: parseSingularOf(value["podcast:remoteitem"], parseRemoteItem) });
|
|
247
249
|
};
|
|
248
250
|
const parseValueTimeSplit = (value) => {
|
|
249
|
-
if (!
|
|
251
|
+
if (!isPlainObject(value)) return;
|
|
250
252
|
return trimObject({
|
|
251
253
|
startTime: parseNumber(value["@starttime"]),
|
|
252
254
|
duration: parseNumber(value["@duration"]),
|
|
@@ -257,7 +259,7 @@ const parseValueTimeSplit = (value) => {
|
|
|
257
259
|
});
|
|
258
260
|
};
|
|
259
261
|
const retrieveItem = (value) => {
|
|
260
|
-
if (!
|
|
262
|
+
if (!isPlainObject(value)) return;
|
|
261
263
|
return trimObject({
|
|
262
264
|
transcripts: parseArrayOf(value["podcast:transcript"], parseTranscript),
|
|
263
265
|
chapters: parseSingularOf(value["podcast:chapters"], parseChapters),
|
|
@@ -276,7 +278,7 @@ const retrieveItem = (value) => {
|
|
|
276
278
|
});
|
|
277
279
|
};
|
|
278
280
|
const retrieveFeed = (value, options) => {
|
|
279
|
-
if (!
|
|
281
|
+
if (!isPlainObject(value)) return;
|
|
280
282
|
return trimObject({
|
|
281
283
|
locked: parseSingularOf(value["podcast:locked"], parseLocked),
|
|
282
284
|
fundings: parseArrayOf(value["podcast:funding"], parseFunding),
|
|
@@ -299,6 +301,5 @@ const retrieveFeed = (value, options) => {
|
|
|
299
301
|
publisher: parseSingularOf(value["podcast:publisher"], parsePublisher)
|
|
300
302
|
});
|
|
301
303
|
};
|
|
302
|
-
|
|
303
304
|
//#endregion
|
|
304
|
-
export { retrieveFeed, retrieveItem };
|
|
305
|
+
export { parseAlternateEnclosure, parseBlock, parseChapters, parseChat, parseContentLink, parseEpisode, parseFunding, parseImage, parseImages, parseIntegrity, parseLicense, parseLiveItem, parseLocation, parseLocked, parsePerson, parsePodping, parsePodroll, parsePublisher, parseRemoteItem, parseSeason, parseSocialInteract, parseSoundbite, parseSource, parseTrailer, parseTranscript, parseTxt, parseUpdateFrequency, parseValue, parseValueRecipient, parseValueTimeSplit, retrieveFeed, retrieveImages, retrieveItem };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
//#region src/namespaces/prism/common/config.ts
|
|
2
|
+
const uris = [
|
|
3
|
+
"http://prismstandard.org/namespaces/basic/3.0/",
|
|
4
|
+
"https://prismstandard.org/namespaces/basic/3.0/",
|
|
5
|
+
"http://prismstandard.org/namespaces/basic/3.0",
|
|
6
|
+
"https://prismstandard.org/namespaces/basic/3.0",
|
|
7
|
+
"http://prismstandard.org/namespaces/basic/2.2/",
|
|
8
|
+
"https://prismstandard.org/namespaces/basic/2.2/",
|
|
9
|
+
"http://prismstandard.org/namespaces/basic/2.2",
|
|
10
|
+
"https://prismstandard.org/namespaces/basic/2.2",
|
|
11
|
+
"http://prismstandard.org/namespaces/basic/2.1/",
|
|
12
|
+
"https://prismstandard.org/namespaces/basic/2.1/",
|
|
13
|
+
"http://prismstandard.org/namespaces/basic/2.1",
|
|
14
|
+
"https://prismstandard.org/namespaces/basic/2.1",
|
|
15
|
+
"http://prismstandard.org/namespaces/basic/2.0/",
|
|
16
|
+
"https://prismstandard.org/namespaces/basic/2.0/",
|
|
17
|
+
"http://prismstandard.org/namespaces/basic/2.0",
|
|
18
|
+
"https://prismstandard.org/namespaces/basic/2.0",
|
|
19
|
+
"http://prismstandard.org/namespaces/2.0/basic/",
|
|
20
|
+
"https://prismstandard.org/namespaces/2.0/basic/",
|
|
21
|
+
"http://prismstandard.org/namespaces/2.0/basic",
|
|
22
|
+
"https://prismstandard.org/namespaces/2.0/basic",
|
|
23
|
+
"http://prismstandard.org/namespaces/1.2/basic/",
|
|
24
|
+
"https://prismstandard.org/namespaces/1.2/basic/",
|
|
25
|
+
"http://prismstandard.org/namespaces/1.2/basic",
|
|
26
|
+
"https://prismstandard.org/namespaces/1.2/basic",
|
|
27
|
+
"http://prismstandard.org/namespaces/1.1/basic/",
|
|
28
|
+
"https://prismstandard.org/namespaces/1.1/basic/",
|
|
29
|
+
"http://prismstandard.org/namespaces/1.1/basic",
|
|
30
|
+
"https://prismstandard.org/namespaces/1.1/basic",
|
|
31
|
+
"http://prismstandard.org/namespaces/1.0/basic/",
|
|
32
|
+
"https://prismstandard.org/namespaces/1.0/basic/",
|
|
33
|
+
"http://prismstandard.org/namespaces/1.0/basic",
|
|
34
|
+
"https://prismstandard.org/namespaces/1.0/basic",
|
|
35
|
+
"http://purl.org/rss/1.0/modules/prism/",
|
|
36
|
+
"https://purl.org/rss/1.0/modules/prism/",
|
|
37
|
+
"http://purl.org/rss/1.0/modules/prism",
|
|
38
|
+
"https://purl.org/rss/1.0/modules/prism"
|
|
39
|
+
];
|
|
40
|
+
const stopNodes = [
|
|
41
|
+
"*.prism:publicationname",
|
|
42
|
+
"*.prism:issn",
|
|
43
|
+
"*.prism:eissn",
|
|
44
|
+
"*.prism:isbn",
|
|
45
|
+
"*.prism:issueidentifier",
|
|
46
|
+
"*.prism:issuename",
|
|
47
|
+
"*.prism:issueteaser",
|
|
48
|
+
"*.prism:issuetype",
|
|
49
|
+
"*.prism:volume",
|
|
50
|
+
"*.prism:number",
|
|
51
|
+
"*.prism:edition",
|
|
52
|
+
"*.prism:aggregateissuenumber",
|
|
53
|
+
"*.prism:aggregationtype",
|
|
54
|
+
"*.prism:coverdate",
|
|
55
|
+
"*.prism:coverdisplaydate",
|
|
56
|
+
"*.prism:publicationdate",
|
|
57
|
+
"*.prism:publicationdisplaydate",
|
|
58
|
+
"*.prism:creationdate",
|
|
59
|
+
"*.prism:modificationdate",
|
|
60
|
+
"*.prism:datereceived",
|
|
61
|
+
"*.prism:onsaledate",
|
|
62
|
+
"*.prism:onsaleday",
|
|
63
|
+
"*.prism:offsaledate",
|
|
64
|
+
"*.prism:killdate",
|
|
65
|
+
"*.prism:copyrightyear",
|
|
66
|
+
"*.prism:contenttype",
|
|
67
|
+
"*.prism:alternatetitle",
|
|
68
|
+
"*.prism:subtitle",
|
|
69
|
+
"*.prism:teaser",
|
|
70
|
+
"*.prism:keyword",
|
|
71
|
+
"*.prism:seriestitle",
|
|
72
|
+
"*.prism:seriesnumber",
|
|
73
|
+
"*.prism:bookedition",
|
|
74
|
+
"*.prism:nationalcatalognumber",
|
|
75
|
+
"*.prism:productcode",
|
|
76
|
+
"*.prism:uspsnumber",
|
|
77
|
+
"*.prism:publishingfrequency",
|
|
78
|
+
"*.prism:channel",
|
|
79
|
+
"*.prism:subchannel1",
|
|
80
|
+
"*.prism:subchannel2",
|
|
81
|
+
"*.prism:subchannel3",
|
|
82
|
+
"*.prism:subchannel4",
|
|
83
|
+
"*.prism:section",
|
|
84
|
+
"*.prism:subsection1",
|
|
85
|
+
"*.prism:subsection2",
|
|
86
|
+
"*.prism:subsection3",
|
|
87
|
+
"*.prism:subsection4",
|
|
88
|
+
"*.prism:corporateentity",
|
|
89
|
+
"*.prism:distributor",
|
|
90
|
+
"*.prism:sellingagency",
|
|
91
|
+
"*.prism:organization",
|
|
92
|
+
"*.prism:person",
|
|
93
|
+
"*.prism:platform",
|
|
94
|
+
"*.prism:originplatform",
|
|
95
|
+
"*.prism:device",
|
|
96
|
+
"*.prism:complianceprofile",
|
|
97
|
+
"*.prism:blogtitle",
|
|
98
|
+
"*.prism:blogurl",
|
|
99
|
+
"*.prism:link",
|
|
100
|
+
"*.prism:url",
|
|
101
|
+
"*.prism:bytecount",
|
|
102
|
+
"*.prism:wordcount",
|
|
103
|
+
"*.prism:pagecount",
|
|
104
|
+
"*.prism:rating",
|
|
105
|
+
"*.prism:timeperiod",
|
|
106
|
+
"*.prism:versionidentifier",
|
|
107
|
+
"*.prism:ticker",
|
|
108
|
+
"*.prism:academicfield",
|
|
109
|
+
"*.prism:event",
|
|
110
|
+
"*.prism:genre",
|
|
111
|
+
"*.prism:industry",
|
|
112
|
+
"*.prism:location",
|
|
113
|
+
"*.prism:object",
|
|
114
|
+
"*.prism:profession",
|
|
115
|
+
"*.prism:sport",
|
|
116
|
+
"*.prism:embargodate",
|
|
117
|
+
"*.prism:copyright",
|
|
118
|
+
"*.prism:expirationdate",
|
|
119
|
+
"*.prism:rightsagent",
|
|
120
|
+
"*.prism:doi",
|
|
121
|
+
"*.prism:startingpage",
|
|
122
|
+
"*.prism:endingpage",
|
|
123
|
+
"*.prism:pagerange",
|
|
124
|
+
"*.prism:pageprogressiondirection",
|
|
125
|
+
"*.prism:samplepagerange",
|
|
126
|
+
"*.prism:hasalternative",
|
|
127
|
+
"*.prism:hascorrection",
|
|
128
|
+
"*.prism:hastranslation",
|
|
129
|
+
"*.prism:isalternativeof",
|
|
130
|
+
"*.prism:iscorrectionof",
|
|
131
|
+
"*.prism:istranslationof",
|
|
132
|
+
"*.prism:supplementtitle",
|
|
133
|
+
"*.prism:supplementdisplayid",
|
|
134
|
+
"*.prism:supplementstartingpage"
|
|
135
|
+
];
|
|
136
|
+
//#endregion
|
|
137
|
+
exports.stopNodes = stopNodes;
|
|
138
|
+
exports.uris = uris;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
//#region src/namespaces/prism/common/config.ts
|
|
2
|
+
const uris = [
|
|
3
|
+
"http://prismstandard.org/namespaces/basic/3.0/",
|
|
4
|
+
"https://prismstandard.org/namespaces/basic/3.0/",
|
|
5
|
+
"http://prismstandard.org/namespaces/basic/3.0",
|
|
6
|
+
"https://prismstandard.org/namespaces/basic/3.0",
|
|
7
|
+
"http://prismstandard.org/namespaces/basic/2.2/",
|
|
8
|
+
"https://prismstandard.org/namespaces/basic/2.2/",
|
|
9
|
+
"http://prismstandard.org/namespaces/basic/2.2",
|
|
10
|
+
"https://prismstandard.org/namespaces/basic/2.2",
|
|
11
|
+
"http://prismstandard.org/namespaces/basic/2.1/",
|
|
12
|
+
"https://prismstandard.org/namespaces/basic/2.1/",
|
|
13
|
+
"http://prismstandard.org/namespaces/basic/2.1",
|
|
14
|
+
"https://prismstandard.org/namespaces/basic/2.1",
|
|
15
|
+
"http://prismstandard.org/namespaces/basic/2.0/",
|
|
16
|
+
"https://prismstandard.org/namespaces/basic/2.0/",
|
|
17
|
+
"http://prismstandard.org/namespaces/basic/2.0",
|
|
18
|
+
"https://prismstandard.org/namespaces/basic/2.0",
|
|
19
|
+
"http://prismstandard.org/namespaces/2.0/basic/",
|
|
20
|
+
"https://prismstandard.org/namespaces/2.0/basic/",
|
|
21
|
+
"http://prismstandard.org/namespaces/2.0/basic",
|
|
22
|
+
"https://prismstandard.org/namespaces/2.0/basic",
|
|
23
|
+
"http://prismstandard.org/namespaces/1.2/basic/",
|
|
24
|
+
"https://prismstandard.org/namespaces/1.2/basic/",
|
|
25
|
+
"http://prismstandard.org/namespaces/1.2/basic",
|
|
26
|
+
"https://prismstandard.org/namespaces/1.2/basic",
|
|
27
|
+
"http://prismstandard.org/namespaces/1.1/basic/",
|
|
28
|
+
"https://prismstandard.org/namespaces/1.1/basic/",
|
|
29
|
+
"http://prismstandard.org/namespaces/1.1/basic",
|
|
30
|
+
"https://prismstandard.org/namespaces/1.1/basic",
|
|
31
|
+
"http://prismstandard.org/namespaces/1.0/basic/",
|
|
32
|
+
"https://prismstandard.org/namespaces/1.0/basic/",
|
|
33
|
+
"http://prismstandard.org/namespaces/1.0/basic",
|
|
34
|
+
"https://prismstandard.org/namespaces/1.0/basic",
|
|
35
|
+
"http://purl.org/rss/1.0/modules/prism/",
|
|
36
|
+
"https://purl.org/rss/1.0/modules/prism/",
|
|
37
|
+
"http://purl.org/rss/1.0/modules/prism",
|
|
38
|
+
"https://purl.org/rss/1.0/modules/prism"
|
|
39
|
+
];
|
|
40
|
+
const stopNodes = [
|
|
41
|
+
"*.prism:publicationname",
|
|
42
|
+
"*.prism:issn",
|
|
43
|
+
"*.prism:eissn",
|
|
44
|
+
"*.prism:isbn",
|
|
45
|
+
"*.prism:issueidentifier",
|
|
46
|
+
"*.prism:issuename",
|
|
47
|
+
"*.prism:issueteaser",
|
|
48
|
+
"*.prism:issuetype",
|
|
49
|
+
"*.prism:volume",
|
|
50
|
+
"*.prism:number",
|
|
51
|
+
"*.prism:edition",
|
|
52
|
+
"*.prism:aggregateissuenumber",
|
|
53
|
+
"*.prism:aggregationtype",
|
|
54
|
+
"*.prism:coverdate",
|
|
55
|
+
"*.prism:coverdisplaydate",
|
|
56
|
+
"*.prism:publicationdate",
|
|
57
|
+
"*.prism:publicationdisplaydate",
|
|
58
|
+
"*.prism:creationdate",
|
|
59
|
+
"*.prism:modificationdate",
|
|
60
|
+
"*.prism:datereceived",
|
|
61
|
+
"*.prism:onsaledate",
|
|
62
|
+
"*.prism:onsaleday",
|
|
63
|
+
"*.prism:offsaledate",
|
|
64
|
+
"*.prism:killdate",
|
|
65
|
+
"*.prism:copyrightyear",
|
|
66
|
+
"*.prism:contenttype",
|
|
67
|
+
"*.prism:alternatetitle",
|
|
68
|
+
"*.prism:subtitle",
|
|
69
|
+
"*.prism:teaser",
|
|
70
|
+
"*.prism:keyword",
|
|
71
|
+
"*.prism:seriestitle",
|
|
72
|
+
"*.prism:seriesnumber",
|
|
73
|
+
"*.prism:bookedition",
|
|
74
|
+
"*.prism:nationalcatalognumber",
|
|
75
|
+
"*.prism:productcode",
|
|
76
|
+
"*.prism:uspsnumber",
|
|
77
|
+
"*.prism:publishingfrequency",
|
|
78
|
+
"*.prism:channel",
|
|
79
|
+
"*.prism:subchannel1",
|
|
80
|
+
"*.prism:subchannel2",
|
|
81
|
+
"*.prism:subchannel3",
|
|
82
|
+
"*.prism:subchannel4",
|
|
83
|
+
"*.prism:section",
|
|
84
|
+
"*.prism:subsection1",
|
|
85
|
+
"*.prism:subsection2",
|
|
86
|
+
"*.prism:subsection3",
|
|
87
|
+
"*.prism:subsection4",
|
|
88
|
+
"*.prism:corporateentity",
|
|
89
|
+
"*.prism:distributor",
|
|
90
|
+
"*.prism:sellingagency",
|
|
91
|
+
"*.prism:organization",
|
|
92
|
+
"*.prism:person",
|
|
93
|
+
"*.prism:platform",
|
|
94
|
+
"*.prism:originplatform",
|
|
95
|
+
"*.prism:device",
|
|
96
|
+
"*.prism:complianceprofile",
|
|
97
|
+
"*.prism:blogtitle",
|
|
98
|
+
"*.prism:blogurl",
|
|
99
|
+
"*.prism:link",
|
|
100
|
+
"*.prism:url",
|
|
101
|
+
"*.prism:bytecount",
|
|
102
|
+
"*.prism:wordcount",
|
|
103
|
+
"*.prism:pagecount",
|
|
104
|
+
"*.prism:rating",
|
|
105
|
+
"*.prism:timeperiod",
|
|
106
|
+
"*.prism:versionidentifier",
|
|
107
|
+
"*.prism:ticker",
|
|
108
|
+
"*.prism:academicfield",
|
|
109
|
+
"*.prism:event",
|
|
110
|
+
"*.prism:genre",
|
|
111
|
+
"*.prism:industry",
|
|
112
|
+
"*.prism:location",
|
|
113
|
+
"*.prism:object",
|
|
114
|
+
"*.prism:profession",
|
|
115
|
+
"*.prism:sport",
|
|
116
|
+
"*.prism:embargodate",
|
|
117
|
+
"*.prism:copyright",
|
|
118
|
+
"*.prism:expirationdate",
|
|
119
|
+
"*.prism:rightsagent",
|
|
120
|
+
"*.prism:doi",
|
|
121
|
+
"*.prism:startingpage",
|
|
122
|
+
"*.prism:endingpage",
|
|
123
|
+
"*.prism:pagerange",
|
|
124
|
+
"*.prism:pageprogressiondirection",
|
|
125
|
+
"*.prism:samplepagerange",
|
|
126
|
+
"*.prism:hasalternative",
|
|
127
|
+
"*.prism:hascorrection",
|
|
128
|
+
"*.prism:hastranslation",
|
|
129
|
+
"*.prism:isalternativeof",
|
|
130
|
+
"*.prism:iscorrectionof",
|
|
131
|
+
"*.prism:istranslationof",
|
|
132
|
+
"*.prism:supplementtitle",
|
|
133
|
+
"*.prism:supplementdisplayid",
|
|
134
|
+
"*.prism:supplementstartingpage"
|
|
135
|
+
];
|
|
136
|
+
//#endregion
|
|
137
|
+
export { stopNodes, uris };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const require_is = require("../../../node_modules/trousse/dist/is.cjs");
|
|
2
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
3
3
|
//#region src/namespaces/prism/generate/utils.ts
|
|
4
4
|
const generateFeed = (feed) => {
|
|
5
|
-
if (!
|
|
5
|
+
if (!require_is.isPlainObject(feed)) return;
|
|
6
6
|
return require_utils.trimObject({
|
|
7
7
|
"prism:publicationName": require_utils.generateCdataString(feed.publicationName),
|
|
8
8
|
"prism:issn": require_utils.generateCdataString(feed.issn),
|
|
@@ -84,7 +84,7 @@ const generateFeed = (feed) => {
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
const generateItem = (item) => {
|
|
87
|
-
if (!
|
|
87
|
+
if (!require_is.isPlainObject(item)) return;
|
|
88
88
|
return require_utils.trimObject({
|
|
89
89
|
"prism:publicationName": require_utils.generateCdataString(item.publicationName),
|
|
90
90
|
"prism:issn": require_utils.generateCdataString(item.issn),
|
|
@@ -148,7 +148,6 @@ const generateItem = (item) => {
|
|
|
148
148
|
"prism:rightsAgent": require_utils.generateCdataString(item.rightsAgent)
|
|
149
149
|
});
|
|
150
150
|
};
|
|
151
|
-
|
|
152
151
|
//#endregion
|
|
153
152
|
exports.generateFeed = generateFeed;
|
|
154
|
-
exports.generateItem = generateItem;
|
|
153
|
+
exports.generateItem = generateItem;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { isPlainObject } from "../../../node_modules/trousse/dist/is.js";
|
|
2
|
+
import { generateCdataString, generateNumber, generateRfc3339Date, trimArray, trimObject } from "../../../common/utils.js";
|
|
3
3
|
//#region src/namespaces/prism/generate/utils.ts
|
|
4
4
|
const generateFeed = (feed) => {
|
|
5
|
-
if (!
|
|
5
|
+
if (!isPlainObject(feed)) return;
|
|
6
6
|
return trimObject({
|
|
7
7
|
"prism:publicationName": generateCdataString(feed.publicationName),
|
|
8
8
|
"prism:issn": generateCdataString(feed.issn),
|
|
@@ -84,7 +84,7 @@ const generateFeed = (feed) => {
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
const generateItem = (item) => {
|
|
87
|
-
if (!
|
|
87
|
+
if (!isPlainObject(item)) return;
|
|
88
88
|
return trimObject({
|
|
89
89
|
"prism:publicationName": generateCdataString(item.publicationName),
|
|
90
90
|
"prism:issn": generateCdataString(item.issn),
|
|
@@ -148,6 +148,5 @@ const generateItem = (item) => {
|
|
|
148
148
|
"prism:rightsAgent": generateCdataString(item.rightsAgent)
|
|
149
149
|
});
|
|
150
150
|
};
|
|
151
|
-
|
|
152
151
|
//#endregion
|
|
153
|
-
export { generateFeed, generateItem };
|
|
152
|
+
export { generateFeed, generateItem };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const require_is = require("../../../node_modules/trousse/dist/is.cjs");
|
|
2
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
3
3
|
//#region src/namespaces/prism/parse/utils.ts
|
|
4
4
|
const retrieveFeed = (value, options) => {
|
|
5
|
-
if (!
|
|
5
|
+
if (!require_is.isPlainObject(value)) return;
|
|
6
6
|
return require_utils.trimObject({
|
|
7
7
|
publicationName: require_utils.parseSingularOf(value["prism:publicationname"], (value) => require_utils.parseString(require_utils.retrieveText(value))),
|
|
8
8
|
issn: require_utils.parseSingularOf(value["prism:issn"], (value) => require_utils.parseString(require_utils.retrieveText(value))),
|
|
@@ -84,7 +84,7 @@ const retrieveFeed = (value, options) => {
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
const retrieveItem = (value, options) => {
|
|
87
|
-
if (!
|
|
87
|
+
if (!require_is.isPlainObject(value)) return;
|
|
88
88
|
return require_utils.trimObject({
|
|
89
89
|
publicationName: require_utils.parseSingularOf(value["prism:publicationname"], (value) => require_utils.parseString(require_utils.retrieveText(value))),
|
|
90
90
|
issn: require_utils.parseSingularOf(value["prism:issn"], (value) => require_utils.parseString(require_utils.retrieveText(value))),
|
|
@@ -148,7 +148,6 @@ const retrieveItem = (value, options) => {
|
|
|
148
148
|
rightsAgent: require_utils.parseSingularOf(value["prism:rightsagent"], (value) => require_utils.parseString(require_utils.retrieveText(value)))
|
|
149
149
|
});
|
|
150
150
|
};
|
|
151
|
-
|
|
152
151
|
//#endregion
|
|
153
152
|
exports.retrieveFeed = retrieveFeed;
|
|
154
|
-
exports.retrieveItem = retrieveItem;
|
|
153
|
+
exports.retrieveItem = retrieveItem;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { isPlainObject } from "../../../node_modules/trousse/dist/is.js";
|
|
2
|
+
import { parseArrayOf, parseDate, parseNumber, parseSingularOf, parseString, retrieveText, trimObject } from "../../../common/utils.js";
|
|
3
3
|
//#region src/namespaces/prism/parse/utils.ts
|
|
4
4
|
const retrieveFeed = (value, options) => {
|
|
5
|
-
if (!
|
|
5
|
+
if (!isPlainObject(value)) return;
|
|
6
6
|
return trimObject({
|
|
7
7
|
publicationName: parseSingularOf(value["prism:publicationname"], (value) => parseString(retrieveText(value))),
|
|
8
8
|
issn: parseSingularOf(value["prism:issn"], (value) => parseString(retrieveText(value))),
|
|
@@ -84,7 +84,7 @@ const retrieveFeed = (value, options) => {
|
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
86
|
const retrieveItem = (value, options) => {
|
|
87
|
-
if (!
|
|
87
|
+
if (!isPlainObject(value)) return;
|
|
88
88
|
return trimObject({
|
|
89
89
|
publicationName: parseSingularOf(value["prism:publicationname"], (value) => parseString(retrieveText(value))),
|
|
90
90
|
issn: parseSingularOf(value["prism:issn"], (value) => parseString(retrieveText(value))),
|
|
@@ -148,6 +148,5 @@ const retrieveItem = (value, options) => {
|
|
|
148
148
|
rightsAgent: parseSingularOf(value["prism:rightsagent"], (value) => parseString(retrieveText(value)))
|
|
149
149
|
});
|
|
150
150
|
};
|
|
151
|
-
|
|
152
151
|
//#endregion
|
|
153
|
-
export { retrieveFeed, retrieveItem };
|
|
152
|
+
export { retrieveFeed, retrieveItem };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/namespaces/psc/common/config.ts
|
|
2
|
+
const uris = [
|
|
3
|
+
"http://podlove.org/simple-chapters",
|
|
4
|
+
"https://podlove.org/simple-chapters",
|
|
5
|
+
"http://podlove.org/simple-chapters/",
|
|
6
|
+
"https://podlove.org/simple-chapters/"
|
|
7
|
+
];
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.uris = uris;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/namespaces/psc/common/config.ts
|
|
2
|
+
const uris = [
|
|
3
|
+
"http://podlove.org/simple-chapters",
|
|
4
|
+
"https://podlove.org/simple-chapters",
|
|
5
|
+
"http://podlove.org/simple-chapters/",
|
|
6
|
+
"https://podlove.org/simple-chapters/"
|
|
7
|
+
];
|
|
8
|
+
//#endregion
|
|
9
|
+
export { uris };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const require_is = require("../../../node_modules/trousse/dist/is.cjs");
|
|
2
|
+
const require_utils = require("../../../common/utils.cjs");
|
|
3
3
|
//#region src/namespaces/psc/generate/utils.ts
|
|
4
4
|
const generateChapter = (chapter) => {
|
|
5
|
-
if (!
|
|
5
|
+
if (!require_is.isPlainObject(chapter)) return;
|
|
6
6
|
return require_utils.trimObject({
|
|
7
7
|
"@start": require_utils.generatePlainString(chapter.start),
|
|
8
8
|
"@title": require_utils.generatePlainString(chapter.title),
|
|
@@ -14,9 +14,10 @@ const generateChapters = (chapters) => {
|
|
|
14
14
|
return require_utils.trimObject({ "psc:chapter": require_utils.trimArray(chapters, generateChapter) });
|
|
15
15
|
};
|
|
16
16
|
const generateItem = (item) => {
|
|
17
|
-
if (!
|
|
17
|
+
if (!require_is.isPlainObject(item)) return;
|
|
18
18
|
return require_utils.trimObject({ "psc:chapters": generateChapters(item.chapters) });
|
|
19
19
|
};
|
|
20
|
-
|
|
21
20
|
//#endregion
|
|
22
|
-
exports.
|
|
21
|
+
exports.generateChapter = generateChapter;
|
|
22
|
+
exports.generateChapters = generateChapters;
|
|
23
|
+
exports.generateItem = generateItem;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { isPlainObject } from "../../../node_modules/trousse/dist/is.js";
|
|
2
|
+
import { generatePlainString, trimArray, trimObject } from "../../../common/utils.js";
|
|
3
3
|
//#region src/namespaces/psc/generate/utils.ts
|
|
4
4
|
const generateChapter = (chapter) => {
|
|
5
|
-
if (!
|
|
5
|
+
if (!isPlainObject(chapter)) return;
|
|
6
6
|
return trimObject({
|
|
7
7
|
"@start": generatePlainString(chapter.start),
|
|
8
8
|
"@title": generatePlainString(chapter.title),
|
|
@@ -14,9 +14,8 @@ const generateChapters = (chapters) => {
|
|
|
14
14
|
return trimObject({ "psc:chapter": trimArray(chapters, generateChapter) });
|
|
15
15
|
};
|
|
16
16
|
const generateItem = (item) => {
|
|
17
|
-
if (!
|
|
17
|
+
if (!isPlainObject(item)) return;
|
|
18
18
|
return trimObject({ "psc:chapters": generateChapters(item.chapters) });
|
|
19
19
|
};
|
|
20
|
-
|
|
21
20
|
//#endregion
|
|
22
|
-
export { generateItem };
|
|
21
|
+
export { generateChapter, generateChapters, generateItem };
|