feedsmith 3.0.0-rc.1 → 3.0.0-rc.3
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/common/config.cjs +1 -0
- package/dist/common/config.js +29 -28
- package/dist/common/parse.d.cts +0 -1
- package/dist/common/parse.d.ts +0 -1
- package/dist/common/types.d.cts +6 -6
- package/dist/common/types.d.ts +6 -6
- package/dist/common/utils.cjs +113 -146
- package/dist/common/utils.js +111 -144
- package/dist/feeds/atom/common/types.d.cts +0 -1
- package/dist/feeds/atom/common/types.d.ts +0 -1
- package/dist/feeds/atom/generate/config.cjs +6 -2
- package/dist/feeds/atom/generate/config.js +5 -1
- package/dist/feeds/atom/generate/index.d.cts +0 -1
- package/dist/feeds/atom/generate/index.d.ts +0 -1
- package/dist/feeds/atom/generate/utils.cjs +45 -8
- package/dist/feeds/atom/generate/utils.js +47 -11
- package/dist/feeds/atom/parse/config.cjs +4 -74
- package/dist/feeds/atom/parse/config.js +6 -73
- package/dist/feeds/atom/parse/index.cjs +20 -3
- package/dist/feeds/atom/parse/index.d.cts +0 -1
- package/dist/feeds/atom/parse/index.d.ts +0 -1
- package/dist/feeds/atom/parse/index.js +20 -3
- package/dist/feeds/atom/parse/utils.cjs +99 -6
- package/dist/feeds/atom/parse/utils.js +96 -8
- package/dist/feeds/json/common/types.d.cts +0 -1
- package/dist/feeds/json/common/types.d.ts +0 -1
- package/dist/feeds/json/generate/index.d.cts +0 -1
- package/dist/feeds/json/generate/index.d.ts +0 -1
- package/dist/feeds/json/parse/index.d.cts +0 -1
- package/dist/feeds/json/parse/index.d.ts +0 -1
- package/dist/feeds/json/parse/utils.cjs +29 -29
- package/dist/feeds/json/parse/utils.js +30 -30
- package/dist/feeds/rdf/common/types.d.cts +0 -1
- package/dist/feeds/rdf/common/types.d.ts +0 -1
- package/dist/feeds/rdf/parse/config.cjs +14 -29
- package/dist/feeds/rdf/parse/config.js +16 -28
- package/dist/feeds/rdf/parse/index.cjs +20 -3
- package/dist/feeds/rdf/parse/index.d.cts +0 -1
- package/dist/feeds/rdf/parse/index.d.ts +0 -1
- package/dist/feeds/rdf/parse/index.js +20 -3
- package/dist/feeds/rss/common/types.d.cts +0 -1
- package/dist/feeds/rss/common/types.d.ts +0 -1
- package/dist/feeds/rss/generate/config.cjs +6 -2
- package/dist/feeds/rss/generate/config.js +5 -1
- package/dist/feeds/rss/generate/index.d.cts +0 -1
- package/dist/feeds/rss/generate/index.d.ts +0 -1
- package/dist/feeds/rss/parse/config.cjs +1 -15
- package/dist/feeds/rss/parse/config.js +3 -15
- package/dist/feeds/rss/parse/index.cjs +19 -3
- package/dist/feeds/rss/parse/index.d.cts +0 -1
- package/dist/feeds/rss/parse/index.d.ts +0 -1
- package/dist/feeds/rss/parse/index.js +19 -3
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/namespaces/atom/common/config.cjs +68 -0
- package/dist/namespaces/atom/common/config.js +65 -1
- package/dist/namespaces/atom/common/types.d.cts +0 -1
- package/dist/namespaces/atom/common/types.d.ts +0 -1
- package/dist/namespaces/georss/common/types.d.cts +0 -1
- package/dist/namespaces/georss/common/types.d.ts +0 -1
- package/dist/namespaces/googleplay/common/types.d.cts +0 -1
- package/dist/namespaces/googleplay/common/types.d.ts +0 -1
- package/dist/namespaces/itunes/common/types.d.cts +14 -8
- package/dist/namespaces/itunes/common/types.d.ts +14 -8
- package/dist/namespaces/media/common/types.d.cts +0 -1
- package/dist/namespaces/media/common/types.d.ts +0 -1
- package/dist/namespaces/opensearch/common/types.d.cts +0 -1
- package/dist/namespaces/opensearch/common/types.d.ts +0 -1
- package/dist/namespaces/podcast/common/types.d.cts +0 -1
- package/dist/namespaces/podcast/common/types.d.ts +0 -1
- package/dist/namespaces/prism/common/types.d.cts +16 -8
- package/dist/namespaces/prism/common/types.d.ts +16 -8
- package/dist/namespaces/psc/common/types.d.cts +0 -1
- package/dist/namespaces/psc/common/types.d.ts +0 -1
- package/dist/namespaces/rawvoice/common/types.d.cts +0 -1
- package/dist/namespaces/rawvoice/common/types.d.ts +0 -1
- package/dist/namespaces/rawvoice/parse/utils.cjs +1 -1
- package/dist/namespaces/rawvoice/parse/utils.js +2 -2
- package/dist/namespaces/source/common/types.d.cts +0 -1
- package/dist/namespaces/source/common/types.d.ts +0 -1
- package/dist/namespaces/spotify/common/types.d.cts +0 -1
- package/dist/namespaces/spotify/common/types.d.ts +0 -1
- package/dist/namespaces/thr/common/types.d.cts +0 -1
- package/dist/namespaces/thr/common/types.d.ts +0 -1
- package/dist/node_modules/trousse/dist/is.cjs +4 -1
- package/dist/node_modules/trousse/dist/is.js +4 -1
- package/dist/node_modules/trousse/dist/json.cjs +16 -0
- package/dist/node_modules/trousse/dist/json.js +16 -0
- package/dist/node_modules/trousse/dist/locales.cjs +15 -0
- package/dist/node_modules/trousse/dist/locales.js +15 -0
- package/dist/node_modules/trousse/dist/urls.cjs +9 -0
- package/dist/node_modules/trousse/dist/urls.js +9 -0
- package/dist/opml/common/types.d.cts +0 -1
- package/dist/opml/common/types.d.ts +0 -1
- package/dist/opml/generate/index.d.cts +0 -1
- package/dist/opml/generate/index.d.ts +0 -1
- package/dist/opml/parse/index.d.cts +0 -1
- package/dist/opml/parse/index.d.ts +0 -1
- package/package.json +6 -6
|
@@ -7,5 +7,69 @@ const uris = [
|
|
|
7
7
|
"http://purl.org/atom/ns#",
|
|
8
8
|
"https://purl.org/atom/ns#"
|
|
9
9
|
];
|
|
10
|
+
const textConstructs = [
|
|
11
|
+
"title",
|
|
12
|
+
"subtitle",
|
|
13
|
+
"rights",
|
|
14
|
+
"summary",
|
|
15
|
+
"content"
|
|
16
|
+
];
|
|
17
|
+
const personPaths = (parent) => [
|
|
18
|
+
`${parent}.name`,
|
|
19
|
+
`${parent}.uri`,
|
|
20
|
+
`${parent}.url`,
|
|
21
|
+
`${parent}.email`
|
|
22
|
+
];
|
|
23
|
+
const feedPaths = [
|
|
24
|
+
...personPaths("author"),
|
|
25
|
+
"category",
|
|
26
|
+
...personPaths("contributor"),
|
|
27
|
+
"generator",
|
|
28
|
+
"icon",
|
|
29
|
+
"id",
|
|
30
|
+
"link",
|
|
31
|
+
"logo",
|
|
32
|
+
"rights",
|
|
33
|
+
"subtitle",
|
|
34
|
+
"tagline",
|
|
35
|
+
"title",
|
|
36
|
+
"updated",
|
|
37
|
+
"modified"
|
|
38
|
+
];
|
|
39
|
+
const entryPaths = [
|
|
40
|
+
...personPaths("author"),
|
|
41
|
+
"category",
|
|
42
|
+
"content",
|
|
43
|
+
...personPaths("contributor"),
|
|
44
|
+
"id",
|
|
45
|
+
"link",
|
|
46
|
+
"published",
|
|
47
|
+
"issued",
|
|
48
|
+
"created",
|
|
49
|
+
"rights",
|
|
50
|
+
...personPaths("source.author"),
|
|
51
|
+
"source.category",
|
|
52
|
+
...personPaths("source.contributor"),
|
|
53
|
+
"source.generator",
|
|
54
|
+
"source.icon",
|
|
55
|
+
"source.id",
|
|
56
|
+
"source.link",
|
|
57
|
+
"source.logo",
|
|
58
|
+
"source.rights",
|
|
59
|
+
"source.subtitle",
|
|
60
|
+
"source.title",
|
|
61
|
+
"source.updated",
|
|
62
|
+
"source.modified",
|
|
63
|
+
"summary",
|
|
64
|
+
"title",
|
|
65
|
+
"updated",
|
|
66
|
+
"modified"
|
|
67
|
+
];
|
|
68
|
+
const prefixSegments = (path) => {
|
|
69
|
+
return path.split(".").map((segment) => `atom:${segment}`).join(".");
|
|
70
|
+
};
|
|
71
|
+
const stopNodes = [.../* @__PURE__ */ new Set([...feedPaths, ...entryPaths])].map((path) => {
|
|
72
|
+
return `*.${prefixSegments(path)}`;
|
|
73
|
+
});
|
|
10
74
|
//#endregion
|
|
11
|
-
export { uris };
|
|
75
|
+
export { entryPaths, feedPaths, stopNodes, textConstructs, uris };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DeepOmit } from "../../../common/types.cjs";
|
|
2
2
|
import { AtomFeed } from "../../../feeds/atom/common/types.cjs";
|
|
3
|
-
|
|
4
3
|
//#region src/namespaces/atom/common/types.d.ts
|
|
5
4
|
type NsKeys = 'admin' | 'app' | 'arxiv' | 'cc' | 'creativeCommons' | 'dc' | 'dcterms' | 'geo' | 'georss' | 'googleplay' | 'itunes' | 'media' | 'opensearch' | 'pingback' | 'psc' | 'slash' | 'sy' | 'thr' | 'trackback' | 'wfw' | 'yt';
|
|
6
5
|
declare namespace AtomNs {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DeepOmit } from "../../../common/types.js";
|
|
2
2
|
import { AtomFeed } from "../../../feeds/atom/common/types.js";
|
|
3
|
-
|
|
4
3
|
//#region src/namespaces/atom/common/types.d.ts
|
|
5
4
|
type NsKeys = 'admin' | 'app' | 'arxiv' | 'cc' | 'creativeCommons' | 'dc' | 'dcterms' | 'geo' | 'georss' | 'googleplay' | 'itunes' | 'media' | 'opensearch' | 'pingback' | 'psc' | 'slash' | 'sy' | 'thr' | 'trackback' | 'wfw' | 'yt';
|
|
6
5
|
declare namespace AtomNs {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Requirable, Strict } from "../../../common/types.cjs";
|
|
2
|
-
|
|
3
2
|
//#region src/namespaces/itunes/common/types.d.ts
|
|
4
3
|
declare namespace ItunesNs {
|
|
5
4
|
type BaseCategory<TStrict extends boolean = false> = Strict<{
|
|
@@ -21,9 +20,12 @@ declare namespace ItunesNs {
|
|
|
21
20
|
episode?: number;
|
|
22
21
|
season?: number;
|
|
23
22
|
episodeType?: string;
|
|
24
|
-
block?: boolean;
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
block?: boolean;
|
|
24
|
+
/** @deprecated Use standard RSS description instead. No longer used by Apple Podcasts. */
|
|
25
|
+
summary?: string;
|
|
26
|
+
/** @deprecated No longer used by Apple Podcasts. */
|
|
27
|
+
subtitle?: string;
|
|
28
|
+
/** @deprecated No longer used for search in Apple Podcasts. */
|
|
27
29
|
keywords?: Array<string>;
|
|
28
30
|
};
|
|
29
31
|
type Feed<TStrict extends boolean = false> = {
|
|
@@ -36,10 +38,14 @@ declare namespace ItunesNs {
|
|
|
36
38
|
newFeedUrl?: string;
|
|
37
39
|
block?: boolean;
|
|
38
40
|
complete?: boolean;
|
|
39
|
-
applePodcastsVerify?: string;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
applePodcastsVerify?: string;
|
|
42
|
+
/** @deprecated Use standard RSS description instead. No longer used by Apple Podcasts. */
|
|
43
|
+
summary?: string;
|
|
44
|
+
/** @deprecated No longer used by Apple Podcasts. */
|
|
45
|
+
subtitle?: string;
|
|
46
|
+
/** @deprecated No longer used for search in Apple Podcasts. */
|
|
47
|
+
keywords?: Array<string>;
|
|
48
|
+
/** @deprecated No longer supported by Apple Podcasts. */
|
|
43
49
|
owner?: Owner;
|
|
44
50
|
};
|
|
45
51
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Requirable, Strict } from "../../../common/types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/namespaces/itunes/common/types.d.ts
|
|
4
3
|
declare namespace ItunesNs {
|
|
5
4
|
type BaseCategory<TStrict extends boolean = false> = Strict<{
|
|
@@ -21,9 +20,12 @@ declare namespace ItunesNs {
|
|
|
21
20
|
episode?: number;
|
|
22
21
|
season?: number;
|
|
23
22
|
episodeType?: string;
|
|
24
|
-
block?: boolean;
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
block?: boolean;
|
|
24
|
+
/** @deprecated Use standard RSS description instead. No longer used by Apple Podcasts. */
|
|
25
|
+
summary?: string;
|
|
26
|
+
/** @deprecated No longer used by Apple Podcasts. */
|
|
27
|
+
subtitle?: string;
|
|
28
|
+
/** @deprecated No longer used for search in Apple Podcasts. */
|
|
27
29
|
keywords?: Array<string>;
|
|
28
30
|
};
|
|
29
31
|
type Feed<TStrict extends boolean = false> = {
|
|
@@ -36,10 +38,14 @@ declare namespace ItunesNs {
|
|
|
36
38
|
newFeedUrl?: string;
|
|
37
39
|
block?: boolean;
|
|
38
40
|
complete?: boolean;
|
|
39
|
-
applePodcastsVerify?: string;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
applePodcastsVerify?: string;
|
|
42
|
+
/** @deprecated Use standard RSS description instead. No longer used by Apple Podcasts. */
|
|
43
|
+
summary?: string;
|
|
44
|
+
/** @deprecated No longer used by Apple Podcasts. */
|
|
45
|
+
subtitle?: string;
|
|
46
|
+
/** @deprecated No longer used for search in Apple Podcasts. */
|
|
47
|
+
keywords?: Array<string>;
|
|
48
|
+
/** @deprecated No longer supported by Apple Podcasts. */
|
|
43
49
|
owner?: Owner;
|
|
44
50
|
};
|
|
45
51
|
}
|
|
@@ -73,10 +73,14 @@ declare namespace PrismNs {
|
|
|
73
73
|
locations?: Array<string>;
|
|
74
74
|
objects?: Array<string>;
|
|
75
75
|
profession?: string;
|
|
76
|
-
sport?: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
sport?: string;
|
|
77
|
+
/** @deprecated Since PRISM 3.0. Use pur:embargoDate instead. */
|
|
78
|
+
embargoDate?: TDate;
|
|
79
|
+
/** @deprecated Since PRISM 3.0. Use pur:copyrightDate instead. */
|
|
80
|
+
copyright?: string;
|
|
81
|
+
/** @deprecated Since PRISM 3.0. Use pur:expirationDate instead. */
|
|
82
|
+
expirationDate?: TDate;
|
|
83
|
+
/** @deprecated Since PRISM 3.0. Use pur:rightsAgent instead. */
|
|
80
84
|
rightsAgent?: string;
|
|
81
85
|
};
|
|
82
86
|
type Item<TDate> = {
|
|
@@ -135,10 +139,14 @@ declare namespace PrismNs {
|
|
|
135
139
|
ratings?: Array<string>;
|
|
136
140
|
timePeriod?: string;
|
|
137
141
|
versionIdentifier?: string;
|
|
138
|
-
tickers?: Array<string>;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
tickers?: Array<string>;
|
|
143
|
+
/** @deprecated Since PRISM 3.0. Use pur:embargoDate instead. */
|
|
144
|
+
embargoDate?: TDate;
|
|
145
|
+
/** @deprecated Since PRISM 3.0. Use pur:copyrightDate instead. */
|
|
146
|
+
copyright?: string;
|
|
147
|
+
/** @deprecated Since PRISM 3.0. Use pur:expirationDate instead. */
|
|
148
|
+
expirationDate?: TDate;
|
|
149
|
+
/** @deprecated Since PRISM 3.0. Use pur:rightsAgent instead. */
|
|
142
150
|
rightsAgent?: string;
|
|
143
151
|
};
|
|
144
152
|
}
|
|
@@ -73,10 +73,14 @@ declare namespace PrismNs {
|
|
|
73
73
|
locations?: Array<string>;
|
|
74
74
|
objects?: Array<string>;
|
|
75
75
|
profession?: string;
|
|
76
|
-
sport?: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
sport?: string;
|
|
77
|
+
/** @deprecated Since PRISM 3.0. Use pur:embargoDate instead. */
|
|
78
|
+
embargoDate?: TDate;
|
|
79
|
+
/** @deprecated Since PRISM 3.0. Use pur:copyrightDate instead. */
|
|
80
|
+
copyright?: string;
|
|
81
|
+
/** @deprecated Since PRISM 3.0. Use pur:expirationDate instead. */
|
|
82
|
+
expirationDate?: TDate;
|
|
83
|
+
/** @deprecated Since PRISM 3.0. Use pur:rightsAgent instead. */
|
|
80
84
|
rightsAgent?: string;
|
|
81
85
|
};
|
|
82
86
|
type Item<TDate> = {
|
|
@@ -135,10 +139,14 @@ declare namespace PrismNs {
|
|
|
135
139
|
ratings?: Array<string>;
|
|
136
140
|
timePeriod?: string;
|
|
137
141
|
versionIdentifier?: string;
|
|
138
|
-
tickers?: Array<string>;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
tickers?: Array<string>;
|
|
143
|
+
/** @deprecated Since PRISM 3.0. Use pur:embargoDate instead. */
|
|
144
|
+
embargoDate?: TDate;
|
|
145
|
+
/** @deprecated Since PRISM 3.0. Use pur:copyrightDate instead. */
|
|
146
|
+
copyright?: string;
|
|
147
|
+
/** @deprecated Since PRISM 3.0. Use pur:expirationDate instead. */
|
|
148
|
+
expirationDate?: TDate;
|
|
149
|
+
/** @deprecated Since PRISM 3.0. Use pur:rightsAgent instead. */
|
|
142
150
|
rightsAgent?: string;
|
|
143
151
|
};
|
|
144
152
|
}
|
|
@@ -31,7 +31,7 @@ const parseAlternateEnclosure = (value) => {
|
|
|
31
31
|
const parseSubscribe = (value) => {
|
|
32
32
|
if (!require_is.isPlainObject(value)) return;
|
|
33
33
|
const subscribe = {};
|
|
34
|
-
for (const key in value) if (
|
|
34
|
+
for (const key in value) if (require_utils.isXmlAttributeKey(key)) {
|
|
35
35
|
const attrName = key.slice(1);
|
|
36
36
|
const attrValue = require_utils.parseString(value[key]);
|
|
37
37
|
if (attrValue) subscribe[attrName] = attrValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isPlainObject } from "../../../node_modules/trousse/dist/is.js";
|
|
2
|
-
import { parseArrayOf, parseDate, parseNumber, parseSingularOf, parseString, parseYesNoBoolean, retrieveText, trimObject } from "../../../common/utils.js";
|
|
2
|
+
import { isXmlAttributeKey, parseArrayOf, parseDate, parseNumber, parseSingularOf, parseString, parseYesNoBoolean, retrieveText, trimObject } from "../../../common/utils.js";
|
|
3
3
|
//#region src/namespaces/rawvoice/parse/utils.ts
|
|
4
4
|
const parseRating = (value) => {
|
|
5
5
|
return trimObject({
|
|
@@ -31,7 +31,7 @@ const parseAlternateEnclosure = (value) => {
|
|
|
31
31
|
const parseSubscribe = (value) => {
|
|
32
32
|
if (!isPlainObject(value)) return;
|
|
33
33
|
const subscribe = {};
|
|
34
|
-
for (const key in value) if (key
|
|
34
|
+
for (const key in value) if (isXmlAttributeKey(key)) {
|
|
35
35
|
const attrName = key.slice(1);
|
|
36
36
|
const attrValue = parseString(value[key]);
|
|
37
37
|
if (attrValue) subscribe[attrName] = attrValue;
|
|
@@ -19,7 +19,10 @@ const isPlainObject = (value) => {
|
|
|
19
19
|
};
|
|
20
20
|
const whitespaceOnlyRegex = /^\p{White_Space}*$/u;
|
|
21
21
|
const isNonEmptyString = (value) => {
|
|
22
|
-
|
|
22
|
+
if (!isString(value) || value === "") return false;
|
|
23
|
+
const code = value.charCodeAt(0);
|
|
24
|
+
if (code > 32 && code < 127) return true;
|
|
25
|
+
return !whitespaceOnlyRegex.test(value);
|
|
23
26
|
};
|
|
24
27
|
//#endregion
|
|
25
28
|
exports.isBoolean = isBoolean;
|
|
@@ -19,7 +19,10 @@ const isPlainObject = (value) => {
|
|
|
19
19
|
};
|
|
20
20
|
const whitespaceOnlyRegex = /^\p{White_Space}*$/u;
|
|
21
21
|
const isNonEmptyString = (value) => {
|
|
22
|
-
|
|
22
|
+
if (!isString(value) || value === "") return false;
|
|
23
|
+
const code = value.charCodeAt(0);
|
|
24
|
+
if (code > 32 && code < 127) return true;
|
|
25
|
+
return !whitespaceOnlyRegex.test(value);
|
|
23
26
|
};
|
|
24
27
|
//#endregion
|
|
25
28
|
export { isBoolean, isNonEmptyString, isNumber, isObject, isPlainObject, isPresent, isString };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region node_modules/trousse/dist/json.js
|
|
2
|
+
const isWhitespaceCode = (code) => {
|
|
3
|
+
return code >= 9 && code <= 13 || code === 32 || code === 160 || code === 5760 || code >= 8192 && code <= 8202 || code === 8232 || code === 8233 || code === 8239 || code === 8287 || code === 12288 || code === 65279;
|
|
4
|
+
};
|
|
5
|
+
const isJsonLike = (value) => {
|
|
6
|
+
if (value.length < 2) return false;
|
|
7
|
+
let start = 0;
|
|
8
|
+
let end = value.length - 1;
|
|
9
|
+
while (start < end && isWhitespaceCode(value.charCodeAt(start))) start++;
|
|
10
|
+
while (end > start && isWhitespaceCode(value.charCodeAt(end))) end--;
|
|
11
|
+
const first = value.charCodeAt(start);
|
|
12
|
+
const last = value.charCodeAt(end);
|
|
13
|
+
return first === 123 && last === 125 || first === 91 && last === 93;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.isJsonLike = isJsonLike;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region node_modules/trousse/dist/json.js
|
|
2
|
+
const isWhitespaceCode = (code) => {
|
|
3
|
+
return code >= 9 && code <= 13 || code === 32 || code === 160 || code === 5760 || code >= 8192 && code <= 8202 || code === 8232 || code === 8233 || code === 8239 || code === 8287 || code === 12288 || code === 65279;
|
|
4
|
+
};
|
|
5
|
+
const isJsonLike = (value) => {
|
|
6
|
+
if (value.length < 2) return false;
|
|
7
|
+
let start = 0;
|
|
8
|
+
let end = value.length - 1;
|
|
9
|
+
while (start < end && isWhitespaceCode(value.charCodeAt(start))) start++;
|
|
10
|
+
while (end > start && isWhitespaceCode(value.charCodeAt(end))) end--;
|
|
11
|
+
const first = value.charCodeAt(start);
|
|
12
|
+
const last = value.charCodeAt(end);
|
|
13
|
+
return first === 123 && last === 125 || first === 91 && last === 93;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { isJsonLike };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region node_modules/trousse/dist/locales.js
|
|
2
|
+
const escapableRegex = /[&<>"']/g;
|
|
3
|
+
const escapeHtml = (value) => {
|
|
4
|
+
return value.replace(escapableRegex, (char) => {
|
|
5
|
+
switch (char) {
|
|
6
|
+
case "&": return "&";
|
|
7
|
+
case "<": return "<";
|
|
8
|
+
case ">": return ">";
|
|
9
|
+
case "\"": return """;
|
|
10
|
+
default: return "'";
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.escapeHtml = escapeHtml;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region node_modules/trousse/dist/locales.js
|
|
2
|
+
const escapableRegex = /[&<>"']/g;
|
|
3
|
+
const escapeHtml = (value) => {
|
|
4
|
+
return value.replace(escapableRegex, (char) => {
|
|
5
|
+
switch (char) {
|
|
6
|
+
case "&": return "&";
|
|
7
|
+
case "<": return "<";
|
|
8
|
+
case ">": return ">";
|
|
9
|
+
case "\"": return """;
|
|
10
|
+
default: return "'";
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { escapeHtml };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ExtraFields, ParseMainOptions as ParseMainOptions$1, Requirable, Strict } from "../../common/types.cjs";
|
|
2
|
-
|
|
3
2
|
//#region src/opml/common/types.d.ts
|
|
4
3
|
type ParseMainOptions<TDate, TExtra extends ReadonlyArray<string> = ReadonlyArray<string>> = ParseMainOptions$1<TDate> & {
|
|
5
4
|
extraOutlineAttributes?: TExtra;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ExtraFields, ParseMainOptions as ParseMainOptions$1, Requirable, Strict } from "../../common/types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/opml/common/types.d.ts
|
|
4
3
|
type ParseMainOptions<TDate, TExtra extends ReadonlyArray<string> = ReadonlyArray<string>> = ParseMainOptions$1<TDate> & {
|
|
5
4
|
extraOutlineAttributes?: TExtra;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DateLike, GenerateMainXmlOptions } from "../../common/types.cjs";
|
|
2
2
|
import { GenerateMainOptions, Opml } from "../common/types.cjs";
|
|
3
|
-
|
|
4
3
|
//#region src/opml/generate/index.d.ts
|
|
5
4
|
declare const generate: <TExtra extends ReadonlyArray<string> = [], S extends boolean = false>(value: S extends true ? Opml.Document<Date, TExtra, true> : Opml.Document<DateLike, TExtra>, options?: GenerateMainXmlOptions<GenerateMainOptions<TExtra>, S>) => string;
|
|
6
5
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DateLike, GenerateMainXmlOptions } from "../../common/types.js";
|
|
2
2
|
import { GenerateMainOptions, Opml } from "../common/types.js";
|
|
3
|
-
|
|
4
3
|
//#region src/opml/generate/index.d.ts
|
|
5
4
|
declare const generate: <TExtra extends ReadonlyArray<string> = [], S extends boolean = false>(value: S extends true ? Opml.Document<Date, TExtra, true> : Opml.Document<DateLike, TExtra>, options?: GenerateMainXmlOptions<GenerateMainOptions<TExtra>, S>) => string;
|
|
6
5
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Opml, ParseMainOptions } from "../common/types.cjs";
|
|
2
|
-
|
|
3
2
|
//#region src/opml/parse/index.d.ts
|
|
4
3
|
declare const parse: <TDate = string, const TExtra extends ReadonlyArray<string> = ReadonlyArray<string>>(value: string, options?: ParseMainOptions<TDate, TExtra>) => Opml.Document<TDate, TExtra>;
|
|
5
4
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Opml, ParseMainOptions } from "../common/types.js";
|
|
2
|
-
|
|
3
2
|
//#region src/opml/parse/index.d.ts
|
|
4
3
|
declare const parse: <TDate = string, const TExtra extends ReadonlyArray<string> = ReadonlyArray<string>>(value: string, options?: ParseMainOptions<TDate, TExtra>) => Opml.Document<TDate, TExtra>;
|
|
5
4
|
//#endregion
|
package/package.json
CHANGED
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"entities": "^7.0.1",
|
|
58
|
-
"fast-xml-parser": "~5.
|
|
58
|
+
"fast-xml-parser": "~5.10.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/bun": "^1.3.14",
|
|
62
|
-
"kvalita": "^1.
|
|
63
|
-
"trousse": "^1.
|
|
64
|
-
"tsdown": "^0.22.
|
|
65
|
-
"vitepress": "^2.0.0-alpha.
|
|
62
|
+
"kvalita": "^1.16.0",
|
|
63
|
+
"trousse": "^1.1.1",
|
|
64
|
+
"tsdown": "^0.22.7",
|
|
65
|
+
"vitepress": "^2.0.0-alpha.18"
|
|
66
66
|
},
|
|
67
|
-
"version": "3.0.0-rc.
|
|
67
|
+
"version": "3.0.0-rc.3"
|
|
68
68
|
}
|