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.
Files changed (99) hide show
  1. package/dist/common/config.cjs +1 -0
  2. package/dist/common/config.js +29 -28
  3. package/dist/common/parse.d.cts +0 -1
  4. package/dist/common/parse.d.ts +0 -1
  5. package/dist/common/types.d.cts +6 -6
  6. package/dist/common/types.d.ts +6 -6
  7. package/dist/common/utils.cjs +113 -146
  8. package/dist/common/utils.js +111 -144
  9. package/dist/feeds/atom/common/types.d.cts +0 -1
  10. package/dist/feeds/atom/common/types.d.ts +0 -1
  11. package/dist/feeds/atom/generate/config.cjs +6 -2
  12. package/dist/feeds/atom/generate/config.js +5 -1
  13. package/dist/feeds/atom/generate/index.d.cts +0 -1
  14. package/dist/feeds/atom/generate/index.d.ts +0 -1
  15. package/dist/feeds/atom/generate/utils.cjs +45 -8
  16. package/dist/feeds/atom/generate/utils.js +47 -11
  17. package/dist/feeds/atom/parse/config.cjs +4 -74
  18. package/dist/feeds/atom/parse/config.js +6 -73
  19. package/dist/feeds/atom/parse/index.cjs +20 -3
  20. package/dist/feeds/atom/parse/index.d.cts +0 -1
  21. package/dist/feeds/atom/parse/index.d.ts +0 -1
  22. package/dist/feeds/atom/parse/index.js +20 -3
  23. package/dist/feeds/atom/parse/utils.cjs +99 -6
  24. package/dist/feeds/atom/parse/utils.js +96 -8
  25. package/dist/feeds/json/common/types.d.cts +0 -1
  26. package/dist/feeds/json/common/types.d.ts +0 -1
  27. package/dist/feeds/json/generate/index.d.cts +0 -1
  28. package/dist/feeds/json/generate/index.d.ts +0 -1
  29. package/dist/feeds/json/parse/index.d.cts +0 -1
  30. package/dist/feeds/json/parse/index.d.ts +0 -1
  31. package/dist/feeds/json/parse/utils.cjs +29 -29
  32. package/dist/feeds/json/parse/utils.js +30 -30
  33. package/dist/feeds/rdf/common/types.d.cts +0 -1
  34. package/dist/feeds/rdf/common/types.d.ts +0 -1
  35. package/dist/feeds/rdf/parse/config.cjs +14 -29
  36. package/dist/feeds/rdf/parse/config.js +16 -28
  37. package/dist/feeds/rdf/parse/index.cjs +20 -3
  38. package/dist/feeds/rdf/parse/index.d.cts +0 -1
  39. package/dist/feeds/rdf/parse/index.d.ts +0 -1
  40. package/dist/feeds/rdf/parse/index.js +20 -3
  41. package/dist/feeds/rss/common/types.d.cts +0 -1
  42. package/dist/feeds/rss/common/types.d.ts +0 -1
  43. package/dist/feeds/rss/generate/config.cjs +6 -2
  44. package/dist/feeds/rss/generate/config.js +5 -1
  45. package/dist/feeds/rss/generate/index.d.cts +0 -1
  46. package/dist/feeds/rss/generate/index.d.ts +0 -1
  47. package/dist/feeds/rss/parse/config.cjs +1 -15
  48. package/dist/feeds/rss/parse/config.js +3 -15
  49. package/dist/feeds/rss/parse/index.cjs +19 -3
  50. package/dist/feeds/rss/parse/index.d.cts +0 -1
  51. package/dist/feeds/rss/parse/index.d.ts +0 -1
  52. package/dist/feeds/rss/parse/index.js +19 -3
  53. package/dist/index.d.cts +0 -1
  54. package/dist/index.d.ts +0 -1
  55. package/dist/namespaces/atom/common/config.cjs +68 -0
  56. package/dist/namespaces/atom/common/config.js +65 -1
  57. package/dist/namespaces/atom/common/types.d.cts +0 -1
  58. package/dist/namespaces/atom/common/types.d.ts +0 -1
  59. package/dist/namespaces/georss/common/types.d.cts +0 -1
  60. package/dist/namespaces/georss/common/types.d.ts +0 -1
  61. package/dist/namespaces/googleplay/common/types.d.cts +0 -1
  62. package/dist/namespaces/googleplay/common/types.d.ts +0 -1
  63. package/dist/namespaces/itunes/common/types.d.cts +14 -8
  64. package/dist/namespaces/itunes/common/types.d.ts +14 -8
  65. package/dist/namespaces/media/common/types.d.cts +0 -1
  66. package/dist/namespaces/media/common/types.d.ts +0 -1
  67. package/dist/namespaces/opensearch/common/types.d.cts +0 -1
  68. package/dist/namespaces/opensearch/common/types.d.ts +0 -1
  69. package/dist/namespaces/podcast/common/types.d.cts +0 -1
  70. package/dist/namespaces/podcast/common/types.d.ts +0 -1
  71. package/dist/namespaces/prism/common/types.d.cts +16 -8
  72. package/dist/namespaces/prism/common/types.d.ts +16 -8
  73. package/dist/namespaces/psc/common/types.d.cts +0 -1
  74. package/dist/namespaces/psc/common/types.d.ts +0 -1
  75. package/dist/namespaces/rawvoice/common/types.d.cts +0 -1
  76. package/dist/namespaces/rawvoice/common/types.d.ts +0 -1
  77. package/dist/namespaces/rawvoice/parse/utils.cjs +1 -1
  78. package/dist/namespaces/rawvoice/parse/utils.js +2 -2
  79. package/dist/namespaces/source/common/types.d.cts +0 -1
  80. package/dist/namespaces/source/common/types.d.ts +0 -1
  81. package/dist/namespaces/spotify/common/types.d.cts +0 -1
  82. package/dist/namespaces/spotify/common/types.d.ts +0 -1
  83. package/dist/namespaces/thr/common/types.d.cts +0 -1
  84. package/dist/namespaces/thr/common/types.d.ts +0 -1
  85. package/dist/node_modules/trousse/dist/is.cjs +4 -1
  86. package/dist/node_modules/trousse/dist/is.js +4 -1
  87. package/dist/node_modules/trousse/dist/json.cjs +16 -0
  88. package/dist/node_modules/trousse/dist/json.js +16 -0
  89. package/dist/node_modules/trousse/dist/locales.cjs +15 -0
  90. package/dist/node_modules/trousse/dist/locales.js +15 -0
  91. package/dist/node_modules/trousse/dist/urls.cjs +9 -0
  92. package/dist/node_modules/trousse/dist/urls.js +9 -0
  93. package/dist/opml/common/types.d.cts +0 -1
  94. package/dist/opml/common/types.d.ts +0 -1
  95. package/dist/opml/generate/index.d.cts +0 -1
  96. package/dist/opml/generate/index.d.ts +0 -1
  97. package/dist/opml/parse/index.d.cts +0 -1
  98. package/dist/opml/parse/index.d.ts +0 -1
  99. 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/georss/common/types.d.ts
4
3
  declare namespace GeoRssNs {
5
4
  type Point<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/georss/common/types.d.ts
4
3
  declare namespace GeoRssNs {
5
4
  type Point<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.cjs";
2
-
3
2
  //#region src/namespaces/googleplay/common/types.d.ts
4
3
  declare namespace GooglePlayNs {
5
4
  type Image<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/googleplay/common/types.d.ts
4
3
  declare namespace GooglePlayNs {
5
4
  type Image<TStrict extends boolean = false> = Strict<{
@@ -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; /** @deprecated Use standard RSS description instead. No longer used by Apple Podcasts. */
25
- summary?: string; /** @deprecated No longer used by Apple Podcasts. */
26
- subtitle?: string; /** @deprecated No longer used for search in Apple Podcasts. */
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; /** @deprecated Use standard RSS description instead. No longer used by Apple Podcasts. */
40
- summary?: string; /** @deprecated No longer used by Apple Podcasts. */
41
- subtitle?: string; /** @deprecated No longer used for search in Apple Podcasts. */
42
- keywords?: Array<string>; /** @deprecated No longer supported by Apple Podcasts. */
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; /** @deprecated Use standard RSS description instead. No longer used by Apple Podcasts. */
25
- summary?: string; /** @deprecated No longer used by Apple Podcasts. */
26
- subtitle?: string; /** @deprecated No longer used for search in Apple Podcasts. */
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; /** @deprecated Use standard RSS description instead. No longer used by Apple Podcasts. */
40
- summary?: string; /** @deprecated No longer used by Apple Podcasts. */
41
- subtitle?: string; /** @deprecated No longer used for search in Apple Podcasts. */
42
- keywords?: Array<string>; /** @deprecated No longer supported by Apple Podcasts. */
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.cjs";
2
-
3
2
  //#region src/namespaces/media/common/types.d.ts
4
3
  declare namespace MediaNs {
5
4
  type Rating<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/media/common/types.d.ts
4
3
  declare namespace MediaNs {
5
4
  type Rating<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.cjs";
2
-
3
2
  //#region src/namespaces/opensearch/common/types.d.ts
4
3
  declare namespace OpenSearchNs {
5
4
  type Query<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/opensearch/common/types.d.ts
4
3
  declare namespace OpenSearchNs {
5
4
  type Query<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.cjs";
2
-
3
2
  //#region src/namespaces/podcast/common/types.d.ts
4
3
  declare namespace PodcastNs {
5
4
  /** @internal Common properties shared by Item and LiveItem. */
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/podcast/common/types.d.ts
4
3
  declare namespace PodcastNs {
5
4
  /** @internal Common properties shared by Item and LiveItem. */
@@ -73,10 +73,14 @@ declare namespace PrismNs {
73
73
  locations?: Array<string>;
74
74
  objects?: Array<string>;
75
75
  profession?: string;
76
- sport?: string; /** @deprecated Since PRISM 3.0. Use pur:embargoDate instead. */
77
- embargoDate?: TDate; /** @deprecated Since PRISM 3.0. Use pur:copyrightDate instead. */
78
- copyright?: string; /** @deprecated Since PRISM 3.0. Use pur:expirationDate instead. */
79
- expirationDate?: TDate; /** @deprecated Since PRISM 3.0. Use pur:rightsAgent instead. */
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>; /** @deprecated Since PRISM 3.0. Use pur:embargoDate instead. */
139
- embargoDate?: TDate; /** @deprecated Since PRISM 3.0. Use pur:copyrightDate instead. */
140
- copyright?: string; /** @deprecated Since PRISM 3.0. Use pur:expirationDate instead. */
141
- expirationDate?: TDate; /** @deprecated Since PRISM 3.0. Use pur:rightsAgent instead. */
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; /** @deprecated Since PRISM 3.0. Use pur:embargoDate instead. */
77
- embargoDate?: TDate; /** @deprecated Since PRISM 3.0. Use pur:copyrightDate instead. */
78
- copyright?: string; /** @deprecated Since PRISM 3.0. Use pur:expirationDate instead. */
79
- expirationDate?: TDate; /** @deprecated Since PRISM 3.0. Use pur:rightsAgent instead. */
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>; /** @deprecated Since PRISM 3.0. Use pur:embargoDate instead. */
139
- embargoDate?: TDate; /** @deprecated Since PRISM 3.0. Use pur:copyrightDate instead. */
140
- copyright?: string; /** @deprecated Since PRISM 3.0. Use pur:expirationDate instead. */
141
- expirationDate?: TDate; /** @deprecated Since PRISM 3.0. Use pur:rightsAgent instead. */
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
  }
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.cjs";
2
-
3
2
  //#region src/namespaces/psc/common/types.d.ts
4
3
  declare namespace PscNs {
5
4
  type Chapter<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/psc/common/types.d.ts
4
3
  declare namespace PscNs {
5
4
  type Chapter<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.cjs";
2
-
3
2
  //#region src/namespaces/rawvoice/common/types.d.ts
4
3
  declare namespace RawVoiceNs {
5
4
  type Rating = {
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/rawvoice/common/types.d.ts
4
3
  declare namespace RawVoiceNs {
5
4
  type Rating = {
@@ -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 (key.startsWith("@")) {
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.startsWith("@")) {
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;
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.cjs";
2
-
3
2
  //#region src/namespaces/source/common/types.d.ts
4
3
  declare namespace SourceNs {
5
4
  type Account<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/source/common/types.d.ts
4
3
  declare namespace SourceNs {
5
4
  type Account<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.cjs";
2
-
3
2
  //#region src/namespaces/spotify/common/types.d.ts
4
3
  declare namespace SpotifyNs {
5
4
  type Limit = {
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/spotify/common/types.d.ts
4
3
  declare namespace SpotifyNs {
5
4
  type Limit = {
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.cjs";
2
-
3
2
  //#region src/namespaces/thr/common/types.d.ts
4
3
  declare namespace ThrNs {
5
4
  type InReplyTo<TStrict extends boolean = false> = Strict<{
@@ -1,5 +1,4 @@
1
1
  import { Requirable, Strict } from "../../../common/types.js";
2
-
3
2
  //#region src/namespaces/thr/common/types.d.ts
4
3
  declare namespace ThrNs {
5
4
  type InReplyTo<TStrict extends boolean = false> = Strict<{
@@ -19,7 +19,10 @@ const isPlainObject = (value) => {
19
19
  };
20
20
  const whitespaceOnlyRegex = /^\p{White_Space}*$/u;
21
21
  const isNonEmptyString = (value) => {
22
- return isString(value) && value !== "" && !whitespaceOnlyRegex.test(value);
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
- return isString(value) && value !== "" && !whitespaceOnlyRegex.test(value);
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 "&amp;";
7
+ case "<": return "&lt;";
8
+ case ">": return "&gt;";
9
+ case "\"": return "&quot;";
10
+ default: return "&#39;";
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 "&amp;";
7
+ case "<": return "&lt;";
8
+ case ">": return "&gt;";
9
+ case "\"": return "&quot;";
10
+ default: return "&#39;";
11
+ }
12
+ });
13
+ };
14
+ //#endregion
15
+ export { escapeHtml };
@@ -0,0 +1,9 @@
1
+ //#region node_modules/trousse/dist/urls.js
2
+ const parseUrl = (value, base) => {
3
+ if (value instanceof URL && base === void 0) return value;
4
+ try {
5
+ return new URL(value, base);
6
+ } catch {}
7
+ };
8
+ //#endregion
9
+ exports.parseUrl = parseUrl;
@@ -0,0 +1,9 @@
1
+ //#region node_modules/trousse/dist/urls.js
2
+ const parseUrl = (value, base) => {
3
+ if (value instanceof URL && base === void 0) return value;
4
+ try {
5
+ return new URL(value, base);
6
+ } catch {}
7
+ };
8
+ //#endregion
9
+ export { parseUrl };
@@ -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.9.3"
58
+ "fast-xml-parser": "~5.10.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/bun": "^1.3.14",
62
- "kvalita": "^1.15.1",
63
- "trousse": "^1.0.0",
64
- "tsdown": "^0.22.3",
65
- "vitepress": "^2.0.0-alpha.17"
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.1"
67
+ "version": "3.0.0-rc.3"
68
68
  }