feedsmith 1.0.0
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/LICENSE +7 -0
- package/README.md +398 -0
- package/dist/common/config.d.ts +6 -0
- package/dist/common/config.js +17 -0
- package/dist/common/config.js.map +1 -0
- package/dist/common/parse.d.ts +18 -0
- package/dist/common/parse.js +25 -0
- package/dist/common/parse.js.map +1 -0
- package/dist/common/types.d.ts +2 -0
- package/dist/common/types.js +2 -0
- package/dist/common/types.js.map +1 -0
- package/dist/common/utils.d.ts +15 -0
- package/dist/common/utils.js +119 -0
- package/dist/common/utils.js.map +1 -0
- package/dist/feeds/atom/config.d.ts +3 -0
- package/dist/feeds/atom/config.js +69 -0
- package/dist/feeds/atom/config.js.map +1 -0
- package/dist/feeds/atom/detect.d.ts +1 -0
- package/dist/feeds/atom/detect.js +4 -0
- package/dist/feeds/atom/detect.js.map +1 -0
- package/dist/feeds/atom/parse.d.ts +2 -0
- package/dist/feeds/atom/parse.js +15 -0
- package/dist/feeds/atom/parse.js.map +1 -0
- package/dist/feeds/atom/schemas.d.ts +1539 -0
- package/dist/feeds/atom/schemas.js +90 -0
- package/dist/feeds/atom/schemas.js.map +1 -0
- package/dist/feeds/atom/types.d.ts +15 -0
- package/dist/feeds/atom/types.js +2 -0
- package/dist/feeds/atom/types.js.map +1 -0
- package/dist/feeds/atom/utils.d.ts +15 -0
- package/dist/feeds/atom/utils.js +199 -0
- package/dist/feeds/atom/utils.js.map +1 -0
- package/dist/feeds/json/detect.d.ts +1 -0
- package/dist/feeds/json/detect.js +5 -0
- package/dist/feeds/json/detect.js.map +1 -0
- package/dist/feeds/json/index.d.ts +3 -0
- package/dist/feeds/json/index.js +4 -0
- package/dist/feeds/json/index.js.map +1 -0
- package/dist/feeds/json/parse.d.ts +2 -0
- package/dist/feeds/json/parse.js +10 -0
- package/dist/feeds/json/parse.js.map +1 -0
- package/dist/feeds/json/schemas.d.ts +373 -0
- package/dist/feeds/json/schemas.js +61 -0
- package/dist/feeds/json/schemas.js.map +1 -0
- package/dist/feeds/json/types.d.ts +7 -0
- package/dist/feeds/json/types.js +2 -0
- package/dist/feeds/json/types.js.map +1 -0
- package/dist/feeds/json/utils.d.ts +10 -0
- package/dist/feeds/json/utils.js +133 -0
- package/dist/feeds/json/utils.js.map +1 -0
- package/dist/feeds/rdf/config.d.ts +3 -0
- package/dist/feeds/rdf/config.js +23 -0
- package/dist/feeds/rdf/config.js.map +1 -0
- package/dist/feeds/rdf/detect.d.ts +1 -0
- package/dist/feeds/rdf/detect.js +4 -0
- package/dist/feeds/rdf/detect.js.map +1 -0
- package/dist/feeds/rdf/index.d.ts +3 -0
- package/dist/feeds/rdf/index.js +4 -0
- package/dist/feeds/rdf/index.js.map +1 -0
- package/dist/feeds/rdf/parse.d.ts +2 -0
- package/dist/feeds/rdf/parse.js +15 -0
- package/dist/feeds/rdf/parse.js.map +1 -0
- package/dist/feeds/rdf/schemas.d.ts +3039 -0
- package/dist/feeds/rdf/schemas.js +44 -0
- package/dist/feeds/rdf/schemas.js.map +1 -0
- package/dist/feeds/rdf/types.d.ts +7 -0
- package/dist/feeds/rdf/types.js +2 -0
- package/dist/feeds/rdf/types.js.map +1 -0
- package/dist/feeds/rdf/utils.d.ts +10 -0
- package/dist/feeds/rdf/utils.js +86 -0
- package/dist/feeds/rdf/utils.js.map +1 -0
- package/dist/feeds/rss/config.d.ts +3 -0
- package/dist/feeds/rss/config.js +48 -0
- package/dist/feeds/rss/config.js.map +1 -0
- package/dist/feeds/rss/detect.d.ts +1 -0
- package/dist/feeds/rss/detect.js +4 -0
- package/dist/feeds/rss/detect.js.map +1 -0
- package/dist/feeds/rss/index.d.ts +3 -0
- package/dist/feeds/rss/index.js +4 -0
- package/dist/feeds/rss/index.js.map +1 -0
- package/dist/feeds/rss/parse.d.ts +2 -0
- package/dist/feeds/rss/parse.js +15 -0
- package/dist/feeds/rss/parse.js.map +1 -0
- package/dist/feeds/rss/schemas.d.ts +3383 -0
- package/dist/feeds/rss/schemas.js +99 -0
- package/dist/feeds/rss/schemas.js.map +1 -0
- package/dist/feeds/rss/types.d.ts +12 -0
- package/dist/feeds/rss/types.js +2 -0
- package/dist/feeds/rss/types.js.map +1 -0
- package/dist/feeds/rss/utils.d.ts +14 -0
- package/dist/feeds/rss/utils.js +169 -0
- package/dist/feeds/rss/utils.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/namespaces/atom/schemas.d.ts +1322 -0
- package/dist/namespaces/atom/schemas.js +4 -0
- package/dist/namespaces/atom/schemas.js.map +1 -0
- package/dist/namespaces/atom/types.d.ts +4 -0
- package/dist/namespaces/atom/types.js +2 -0
- package/dist/namespaces/atom/types.js.map +1 -0
- package/dist/namespaces/atom/utils.d.ts +4 -0
- package/dist/namespaces/atom/utils.js +10 -0
- package/dist/namespaces/atom/utils.js.map +1 -0
- package/dist/namespaces/content/schemas.d.ts +8 -0
- package/dist/namespaces/content/schemas.js +10 -0
- package/dist/namespaces/content/schemas.js.map +1 -0
- package/dist/namespaces/content/types.d.ts +3 -0
- package/dist/namespaces/content/types.js +2 -0
- package/dist/namespaces/content/types.js.map +1 -0
- package/dist/namespaces/content/utils.d.ts +3 -0
- package/dist/namespaces/content/utils.js +13 -0
- package/dist/namespaces/content/utils.js.map +1 -0
- package/dist/namespaces/dc/schemas.d.ts +50 -0
- package/dist/namespaces/dc/schemas.js +21 -0
- package/dist/namespaces/dc/schemas.js.map +1 -0
- package/dist/namespaces/dc/types.d.ts +3 -0
- package/dist/namespaces/dc/types.js +2 -0
- package/dist/namespaces/dc/types.js.map +1 -0
- package/dist/namespaces/dc/utils.d.ts +3 -0
- package/dist/namespaces/dc/utils.js +27 -0
- package/dist/namespaces/dc/utils.js.map +1 -0
- package/dist/namespaces/sy/schemas.d.ts +14 -0
- package/dist/namespaces/sy/schemas.js +9 -0
- package/dist/namespaces/sy/schemas.js.map +1 -0
- package/dist/namespaces/sy/types.d.ts +3 -0
- package/dist/namespaces/sy/types.js +2 -0
- package/dist/namespaces/sy/types.js.map +1 -0
- package/dist/namespaces/sy/utils.d.ts +3 -0
- package/dist/namespaces/sy/utils.js +15 -0
- package/dist/namespaces/sy/utils.js.map +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 Maciej Lamberski
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
# Feedsmith
|
|
2
|
+
|
|
3
|
+
Modern JavaScript utility for parsing JSON Feed, Atom, RSS, and RDF feeds, with support for popular namespaces.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/macieklamberski/feedsmith/actions/workflows/test.yml)
|
|
6
|
+
[](https://www.npmjs.com/package/feedsmith)
|
|
7
|
+
[](https://github.com/feedsmith/feedsmith/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
#### Universal and dedicated parsers
|
|
12
|
+
* Parse any feed format with a single function that automatically identifies JSON Feed, Atom, RSS, and RDF feeds.
|
|
13
|
+
* Or… use dedicated functions when you know the feed type.
|
|
14
|
+
* Dublin Core, Syndication, Content, and Atom namespace support. Support for other namespaces is in the works.
|
|
15
|
+
|
|
16
|
+
#### Advantages
|
|
17
|
+
* Get access to all the information in the feed, as Feedsmith preserves the original feed structure exactly as provided in each specific format. TypeScript type definitions are available for each feed type, making it easy to work with the data.
|
|
18
|
+
|
|
19
|
+
#### Leniency
|
|
20
|
+
* **Normalizes legacy elements** ✨ — Upgrades feed elements to their modern equivalents so that you never need to worry about reading feeds in older formats.
|
|
21
|
+
* **CaSe INSENsiTive** — Handles JSON properties and XML tags in any case (lowercase, uppercase, mixed).
|
|
22
|
+
|
|
23
|
+
#### Performance and type-safety
|
|
24
|
+
* **Fast parsing** — Built on [fast-xml-parser](https://www.npmjs.com/package/fast-xml-parser) for efficient XML processing.
|
|
25
|
+
* **Type-safe APIs** — Full TypeScript support with comprehensive type definitions.
|
|
26
|
+
* **Well tested** — Comprehensive test suite with over 450 tests and 99.9% code coverage based on `bun test --coverage`.
|
|
27
|
+
* **Tree-shakable** — Only include the parts of the library you need, reducing bundle size.
|
|
28
|
+
|
|
29
|
+
## Supported feeds and namespaces
|
|
30
|
+
|
|
31
|
+
#### Feeds
|
|
32
|
+
|
|
33
|
+
* [x] [Atom](https://tools.ietf.org/html/rfc4287) (versions: `0.3`, `1.0`)
|
|
34
|
+
* [x] [RSS](http://cyber.law.harvard.edu/rss/rss.html) (versions: `0.90`, `0.91`, `0.92`, `0.93`, `0.94`, `2.0`)
|
|
35
|
+
* [x] [JSON](https://jsonfeed.org) (versions: `1.0`, `1.1`)
|
|
36
|
+
* [x] [RDF](https://web.resource.org/rss/1.0/spec) (versions: `0.9`, `1.0`)
|
|
37
|
+
|
|
38
|
+
#### Namespaces
|
|
39
|
+
|
|
40
|
+
* [x] [Atom](http://www.w3.org/2005/Atom) (as both `<atom:*>` and `<a10:*>`)
|
|
41
|
+
* [x] [Dublin Core](http://purl.org/dc/elements/1.1/) (`<dc:*>`)
|
|
42
|
+
* [x] [Syndication](http://purl.org/rss/1.0/modules/syndication/) (`<sy:*>`)
|
|
43
|
+
* [x] [Content](http://purl.org/rss/1.0/modules/content/) (`<content:*>`)
|
|
44
|
+
* [ ] 🏗️ [iTunes](http://www.itunes.com/dtds/podcast-1.0.dtd) (`<itunes:*>`)
|
|
45
|
+
* [ ] 🏗️ [Podcast](https://podcastindex.org/namespace/1.0) (`<podcast:*>`)
|
|
46
|
+
* [ ] 🏗️ [Media RSS](http://search.yahoo.com/mrss/) (`<media:*>`)
|
|
47
|
+
* [ ] 🏗️ [Geo RSS](http://www.georss.org/georss) (`<georss:*>`)
|
|
48
|
+
* [ ] 🏗️ [Dublin Core Terms](http://purl.org/dc/terms/) (`<dcterms:*>`)
|
|
49
|
+
* [ ] 🏗️ [Administrative](https://web.resource.org/rss/1.0/modules/admin/) (`<admin:*>`)
|
|
50
|
+
* [ ] 🏗️ [Atom Threading](https://www.ietf.org/rfc/rfc4685.txt) (`<thr:*>`)
|
|
51
|
+
* [ ] Need something else?
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install feedsmith
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Parsing feeds
|
|
60
|
+
|
|
61
|
+
### Universal parser
|
|
62
|
+
|
|
63
|
+
The easiest way to parse any feed is to use the universal `parseFeed` function:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { parseFeed } from 'feedsmith'
|
|
67
|
+
|
|
68
|
+
const { type, feed } = parseFeed('feedContent')
|
|
69
|
+
|
|
70
|
+
console.log('Feed type:', type)
|
|
71
|
+
console.log('Feed title:', feed.title)
|
|
72
|
+
|
|
73
|
+
if (type === 'atom') {
|
|
74
|
+
console.log('Atom feed ID:', feed.id)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (type === 'rss') {
|
|
78
|
+
console.log('RSS feed link:', feed.link)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (type === 'json') {
|
|
82
|
+
console.log('JSON feed version:', feed.version)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (type === 'rdf') {
|
|
86
|
+
console.log('RDF feed link:', feed.link)
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Dedicated parsers
|
|
91
|
+
|
|
92
|
+
If you know the format in advance, you can use the format-specific parsers:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import { parseAtomFeed, parseJsonFeed, parseRssFeed, parseRdfFeed } from 'feedsmith'
|
|
96
|
+
|
|
97
|
+
// Parse the feed content.
|
|
98
|
+
const atomFeed = parseAtomFeed(atomContent)
|
|
99
|
+
const jsonFeed = parseJsonFeed(jsonContent)
|
|
100
|
+
const rssFeed = parseRssFeed(rssContent)
|
|
101
|
+
const rdfFeed = parseRdfFeed(rdfContent)
|
|
102
|
+
|
|
103
|
+
// Then read the TypeScript suggestions for the specific feed type.
|
|
104
|
+
rssFeed.title
|
|
105
|
+
rssFeed.dc?.creator
|
|
106
|
+
rssFeed.dc?.date
|
|
107
|
+
rssFeed.sy?.updateBase
|
|
108
|
+
rssFeed.items?.[0]?.title
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Returned values
|
|
112
|
+
|
|
113
|
+
The objects returned from the parser functions are highly comprehensive, aiming to recreate the actual feed structure and its values, including all the supported namespaces. Below are some examples of what is available.
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { parseAtomFeed } from 'feedsmith'
|
|
117
|
+
|
|
118
|
+
const atomFeed = parseAtomFeed(`
|
|
119
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
120
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
|
121
|
+
<title>Example Feed</title>
|
|
122
|
+
<id>example-feed</id>
|
|
123
|
+
<dc:creator>John Doe</dc:creator>
|
|
124
|
+
<dc:contributor>Jane Smith</dc:contributor>
|
|
125
|
+
<dc:date>2022-01-01T12:00+00:00</dc:date>
|
|
126
|
+
<dc:description>This is an example of description.</dc:description>
|
|
127
|
+
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
|
|
128
|
+
<sy:updatePeriod>hourly</sy:updatePeriod>
|
|
129
|
+
<sy:updateFrequency>1</sy:updateFrequency>
|
|
130
|
+
<entry>
|
|
131
|
+
<title>Example Entry</title>
|
|
132
|
+
<id>example-entry</id>
|
|
133
|
+
<dc:creator>Jack Jackson</dc:creator>
|
|
134
|
+
<dc:date>2022-01-01T12:00+00:00</dc:date>
|
|
135
|
+
</entry>
|
|
136
|
+
</feed>
|
|
137
|
+
`)
|
|
138
|
+
|
|
139
|
+
atomFeed.title // → Example Feed
|
|
140
|
+
atomFeed.dc?.contributor // → Jane Smith
|
|
141
|
+
atomFeed.dc?.date // → 2022-01-01T12:00+00:00
|
|
142
|
+
atomFeed.sy?.updateFrequency // → 1
|
|
143
|
+
atomFeed.entries?.[0]?.title // → Example Entry
|
|
144
|
+
atomFeed.entries?.[0]?.dc?.creator // → Jack Jackson
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"id": "example-feed",
|
|
152
|
+
"title": "Example Feed",
|
|
153
|
+
"entries": [
|
|
154
|
+
{
|
|
155
|
+
"id": "example-entry",
|
|
156
|
+
"title": "Example Entry",
|
|
157
|
+
"dc": {
|
|
158
|
+
"creator": "Jack Jackson",
|
|
159
|
+
"date": "2022-01-01T12:00+00:00"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"dc": {
|
|
164
|
+
"creator": "John Doe",
|
|
165
|
+
"description": "This is an example of description.",
|
|
166
|
+
"contributor": "Jane Smith",
|
|
167
|
+
"date": "2022-01-01T12:00+00:00"
|
|
168
|
+
},
|
|
169
|
+
"sy": {
|
|
170
|
+
"updatePeriod": "hourly",
|
|
171
|
+
"updateFrequency": 1,
|
|
172
|
+
"updateBase": "2000-01-01T12:00+00:00"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
<details>
|
|
178
|
+
<summary>Example of a more complex RSS feed 📜</summary>
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
import { parseRssFeed } from 'feedsmith'
|
|
182
|
+
|
|
183
|
+
const rssFeed = parseRssFeed(`
|
|
184
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
185
|
+
<rss version="2.0">
|
|
186
|
+
<channel>
|
|
187
|
+
<title><![CDATA[Sample Feed]]></title>
|
|
188
|
+
<link>http://example.org/</link>
|
|
189
|
+
<description>For documentation <em>only</em></description>
|
|
190
|
+
<language>en</language>
|
|
191
|
+
<webMaster>webmaster@example.org</webMaster>
|
|
192
|
+
<pubDate>Sat, 19 Mar 1988 07:15:00 GMT</pubDate>
|
|
193
|
+
<lastBuildDate>Sat, 19 Mar 1988 07:15:00 GMT</lastBuildDate>
|
|
194
|
+
<category domain="http://www.example.com/cusips">Examples2</category>
|
|
195
|
+
<generator>Sample Toolkit</generator>
|
|
196
|
+
<docs>http://feedvalidator.org/docs/rss2.html</docs>
|
|
197
|
+
<cloud domain="rpc.example.com" port="80" path="/RPC2" registerProcedure="pingMe" protocol="soap" />
|
|
198
|
+
<ttl>60</ttl>
|
|
199
|
+
<image>
|
|
200
|
+
<title>Example banner</title>
|
|
201
|
+
<url>http://example.org/banner.png</url>
|
|
202
|
+
<link>http://example.org/</link>
|
|
203
|
+
<description>Quos placeat quod ea temporibus ratione</description>
|
|
204
|
+
<width>80</width>
|
|
205
|
+
<height>15</height>
|
|
206
|
+
</image>
|
|
207
|
+
<textInput>
|
|
208
|
+
<title>Search</title>
|
|
209
|
+
<description><![CDATA[Search this site:]]></description>
|
|
210
|
+
<name>q</name>
|
|
211
|
+
<link>http://example.org/mt/mt-search.cgi</link>
|
|
212
|
+
</textInput>
|
|
213
|
+
<skipHours>
|
|
214
|
+
<hour>0</hour>
|
|
215
|
+
<hour>20</hour>
|
|
216
|
+
<hour>21</hour>
|
|
217
|
+
<hour>22</hour>
|
|
218
|
+
<hour>23</hour>
|
|
219
|
+
</skipHours>
|
|
220
|
+
<skipDays>
|
|
221
|
+
<day>Monday</day>
|
|
222
|
+
<day>Wednesday</day>
|
|
223
|
+
<day>Friday</day>
|
|
224
|
+
</skipDays>
|
|
225
|
+
<item>
|
|
226
|
+
<title>First item title</title>
|
|
227
|
+
<link>http://example.org/item/1</link>
|
|
228
|
+
<description>Some description of the first item.</description>
|
|
229
|
+
<comments>http://example.org/comments/1</comments>
|
|
230
|
+
<enclosure url="http://example.org/audio/demo.mp3" length="1069871" type="audio/mpeg" />
|
|
231
|
+
<guid isPermaLink="true">http://example.org/guid/1</guid>
|
|
232
|
+
<pubDate>Thu, 05 Sep 2002 0:00:01 GMT</pubDate>
|
|
233
|
+
<source url="http://www.example.org/links.xml">Example's Realm</source>
|
|
234
|
+
</item>
|
|
235
|
+
</channel>
|
|
236
|
+
</rss>
|
|
237
|
+
`)
|
|
238
|
+
|
|
239
|
+
rssFeed.title // → Sample Feed
|
|
240
|
+
rssFeed.textInput?.description // → Search this site:
|
|
241
|
+
rssFeed.items?.length // → 1
|
|
242
|
+
rssFeed.items?.[0]?.enclosure?.url // → http://example.org/audio/demo.mp3
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Returns:
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"title": "Sample Feed",
|
|
250
|
+
"link": "http://example.org/",
|
|
251
|
+
"description": "For documentation <em>only</em>",
|
|
252
|
+
"language": "en",
|
|
253
|
+
"webMaster": "webmaster@example.org",
|
|
254
|
+
"pubDate": "Sat, 19 Mar 1988 07:15:00 GMT",
|
|
255
|
+
"lastBuildDate": "Sat, 19 Mar 1988 07:15:00 GMT",
|
|
256
|
+
"categories": [{ "name": "Examples2", "domain": "http://www.example.com/cusips" }],
|
|
257
|
+
"generator": "Sample Toolkit",
|
|
258
|
+
"docs": "http://feedvalidator.org/docs/rss2.html",
|
|
259
|
+
"cloud": {
|
|
260
|
+
"domain": "rpc.example.com",
|
|
261
|
+
"port": 80,
|
|
262
|
+
"path": "/RPC2",
|
|
263
|
+
"registerProcedure": "pingMe",
|
|
264
|
+
"protocol": "soap"
|
|
265
|
+
},
|
|
266
|
+
"ttl": 60,
|
|
267
|
+
"image": {
|
|
268
|
+
"url": "http://example.org/banner.png",
|
|
269
|
+
"title": "Example banner",
|
|
270
|
+
"link": "http://example.org/",
|
|
271
|
+
"description": "Quos placeat quod ea temporibus ratione",
|
|
272
|
+
"height": 15,
|
|
273
|
+
"width": 80
|
|
274
|
+
},
|
|
275
|
+
"textInput": {
|
|
276
|
+
"title": "Search",
|
|
277
|
+
"description": "Search this site:",
|
|
278
|
+
"name": "q",
|
|
279
|
+
"link": "http://example.org/mt/mt-search.cgi"
|
|
280
|
+
},
|
|
281
|
+
"skipHours": [0, 20, 21, 22, 23],
|
|
282
|
+
"skipDays": ["Monday", "Wednesday", "Friday"],
|
|
283
|
+
"items": [
|
|
284
|
+
{
|
|
285
|
+
"title": "First item title",
|
|
286
|
+
"link": "http://example.org/item/1",
|
|
287
|
+
"description": "Some description of the first item.",
|
|
288
|
+
"comments": "http://example.org/comments/1",
|
|
289
|
+
"enclosure": {
|
|
290
|
+
"url": "http://example.org/audio/demo.mp3",
|
|
291
|
+
"length": 1069871,
|
|
292
|
+
"type": "audio/mpeg"
|
|
293
|
+
},
|
|
294
|
+
"guid": "http://example.org/guid/1",
|
|
295
|
+
"pubDate": "Thu, 05 Sep 2002 0:00:01 GMT",
|
|
296
|
+
"source": { "title": "Example's Realm", "url": "http://www.example.org/links.xml" }
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
</details>
|
|
302
|
+
|
|
303
|
+
For more examples, check the _*/references_ folders located in the source code. There, you'll find the complete objects returned from the parser functions for all feed formats and versions.
|
|
304
|
+
|
|
305
|
+
* Atom examples: [src/feeds/atom/references](https://github.com/macieklamberski/feedsmith/blob/main/src/feeds/atom/references),
|
|
306
|
+
* JSON examples: [src/feeds/json/references](https://github.com/macieklamberski/feedsmith/blob/main/src/feeds/json/references),
|
|
307
|
+
* RSS examples: [src/feeds/rss/references](https://github.com/macieklamberski/feedsmith/blob/main/src/feeds/rss/references),
|
|
308
|
+
* RDF examples: [src/feeds/rdf/references](https://github.com/macieklamberski/feedsmith/blob/main/src/feeds/rdf/references).
|
|
309
|
+
|
|
310
|
+
### Error handling
|
|
311
|
+
|
|
312
|
+
If the feed is unrecognized or invalid, an `Error` will be thrown with a descriptive message.
|
|
313
|
+
|
|
314
|
+
```ts
|
|
315
|
+
import { parseFeed, parseJsonFeed } from 'feedsmith'
|
|
316
|
+
|
|
317
|
+
try {
|
|
318
|
+
const universalFeed = parseFeed('<not-a-feed></not-a-feed>')
|
|
319
|
+
} catch (error) {
|
|
320
|
+
// Error: Unrecognized feed format
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
try {
|
|
324
|
+
const jsonFeed = parseJsonFeed('{}')
|
|
325
|
+
} catch (error) {
|
|
326
|
+
// Error: Invalid feed format
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Format detection
|
|
331
|
+
|
|
332
|
+
You can detect feed formats without parsing them.
|
|
333
|
+
|
|
334
|
+
```ts
|
|
335
|
+
import { detectAtomFeed, detectJsonFeed, detectRssFeed, detectRdfFeed } from 'feedsmith'
|
|
336
|
+
|
|
337
|
+
if (detectAtomFeed(content)) {
|
|
338
|
+
console.log('This is an Atom feed')
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (detectJsonFeed(content)) {
|
|
342
|
+
console.log('This is a JSON feed')
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (detectRssFeed(content)) {
|
|
346
|
+
console.log('This is an RSS feed')
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (detectRdfFeed(content)) {
|
|
350
|
+
console.log('This is an RDF feed')
|
|
351
|
+
}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
**⚠️ Important note:** Detect functions are designed to quickly identify the type of feed by searching for the signature of the feed, such as the `<rss>` tag in the case of RSS feeds. However, it is possible for the function to detect an RSS feed, even if that feed is invalid. Only when using the `parseRssFeed` function will the feed be fully validated.
|
|
355
|
+
|
|
356
|
+
## FAQ
|
|
357
|
+
|
|
358
|
+
### Why should I use Feedsmith instead of alternative modules?
|
|
359
|
+
|
|
360
|
+
As stated in the Features section, the key advantage of Feedsmith is that it preserves the original feed structure exactly as provided in each specific feed format.
|
|
361
|
+
|
|
362
|
+
Many competing packages attempt to normalize data by:
|
|
363
|
+
* Merging distinct fields like `author`, `dc:creator`, and `creator` into a single property.
|
|
364
|
+
* Combining date fields such as `dc:date` and `pubDate` without preserving their source.
|
|
365
|
+
* Handling multiple `<atom:link>` elements inconsistently, sometimes only keeping the first/last one or ignoring different `rel` attributes.
|
|
366
|
+
|
|
367
|
+
Some libraries try to combine different feed formats into one universal structure, which can lead to loss of information.
|
|
368
|
+
|
|
369
|
+
Also, Feedsmith is a bit faster than other packages. Still, this is not a very differentiated space and other newer packages can catch up.
|
|
370
|
+
|
|
371
|
+
### Why are date fields returned as strings?
|
|
372
|
+
|
|
373
|
+
In the course of parsing hundreds of thousands of feeds, we've found that dates in feeds use many different formats. Rather than attempting to parse them all (and potentially introducing errors), we return dates in their original string form, allowing you to use your preferred date parsing library.
|
|
374
|
+
|
|
375
|
+
### Does Feedsmith validate feeds?
|
|
376
|
+
|
|
377
|
+
Feedsmith focuses on parsing feeds rather than validating them. It will extract whatever valid data it can find, even from partially valid feeds. This approach makes it more resilient when dealing with feeds found in the wild.
|
|
378
|
+
|
|
379
|
+
It will only fail if the feed is completely invalid or it does not contain all the fields required according to the specification.
|
|
380
|
+
|
|
381
|
+
### How does Feedsmith handle missing or incomplete data?
|
|
382
|
+
|
|
383
|
+
Feedsmith is designed to be forgiving. It will extract whatever valid data it can find and ignore missing or invalid elements. This makes it suitable for use with real-world feeds that may not strictly follow specifications.
|
|
384
|
+
|
|
385
|
+
### Does Feedsmith work in the browser?
|
|
386
|
+
|
|
387
|
+
Even though Feedsmith is more suited for the Node.js environments, it was also tested in modern browsers where it works seamlessly. It's provided as an ES module.
|
|
388
|
+
|
|
389
|
+
## Acknowledgements
|
|
390
|
+
|
|
391
|
+
* The library API is inspired by the [FeedKit library for Swift](https://github.com/nmdias/FeedKit).
|
|
392
|
+
* XML parsing is provided by [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser).
|
|
393
|
+
* HTML entity decoding is handled by [entities](https://github.com/fb55/entities).
|
|
394
|
+
|
|
395
|
+
## License
|
|
396
|
+
|
|
397
|
+
Licensed under the [MIT](LICENSE) license.<br/>
|
|
398
|
+
Copyright © 2025, Maciej Lamberski
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const parserConfig = {
|
|
2
|
+
trimValues: false,
|
|
3
|
+
processEntities: false,
|
|
4
|
+
htmlEntities: false,
|
|
5
|
+
parseTagValue: false,
|
|
6
|
+
parseAttributeValue: false,
|
|
7
|
+
alwaysCreateTextNode: true,
|
|
8
|
+
ignoreAttributes: false,
|
|
9
|
+
attributeNamePrefix: '@',
|
|
10
|
+
transformTagName: (name) => name.toLowerCase(),
|
|
11
|
+
transformAttributeName: (name) => name.toLowerCase(),
|
|
12
|
+
};
|
|
13
|
+
export const locales = {
|
|
14
|
+
unrecognized: 'Unrecognized feed format',
|
|
15
|
+
invalid: 'Invalid feed format',
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/common/config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAe;IACtC,UAAU,EAAE,KAAK;IACjB,eAAe,EAAE,KAAK;IACtB,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,KAAK;IACpB,mBAAmB,EAAE,KAAK;IAC1B,oBAAoB,EAAE,IAAI;IAC1B,gBAAgB,EAAE,KAAK;IACvB,mBAAmB,EAAE,GAAG;IACxB,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE;IAC9C,sBAAsB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE;CACrD,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,YAAY,EAAE,0BAA0B;IACxC,OAAO,EAAE,qBAAqB;CAC/B,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Feed as AtomFeed } from '../feeds/atom/types';
|
|
2
|
+
import type { Feed as JsonFeed } from '../feeds/json/types';
|
|
3
|
+
import type { Feed as RdfFeed } from '../feeds/rdf/types';
|
|
4
|
+
import type { Feed as RssFeed } from '../feeds/rss/types';
|
|
5
|
+
export type Feed = {
|
|
6
|
+
type: 'json';
|
|
7
|
+
feed: JsonFeed;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'rss';
|
|
10
|
+
feed: RssFeed;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'atom';
|
|
13
|
+
feed: AtomFeed;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'rdf';
|
|
16
|
+
feed: RdfFeed;
|
|
17
|
+
};
|
|
18
|
+
export declare const parse: (value: unknown) => Feed;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { detect as detectAtomFeed } from '../feeds/atom/detect';
|
|
2
|
+
import { parse as parseAtomFeed } from '../feeds/atom/parse';
|
|
3
|
+
import { detect as detectJsonFeed } from '../feeds/json/detect';
|
|
4
|
+
import { parse as parseJsonFeed } from '../feeds/json/parse';
|
|
5
|
+
import { detect as detectRdfFeed } from '../feeds/rdf/detect';
|
|
6
|
+
import { parse as parseRdfFeed } from '../feeds/rdf/parse';
|
|
7
|
+
import { detect as detectRssFeed } from '../feeds/rss/detect';
|
|
8
|
+
import { parse as parseRssFeed } from '../feeds/rss/parse';
|
|
9
|
+
import { locales } from './config';
|
|
10
|
+
export const parse = (value) => {
|
|
11
|
+
if (detectAtomFeed(value)) {
|
|
12
|
+
return { type: 'atom', feed: parseAtomFeed(value) };
|
|
13
|
+
}
|
|
14
|
+
if (detectJsonFeed(value)) {
|
|
15
|
+
return { type: 'json', feed: parseJsonFeed(value) };
|
|
16
|
+
}
|
|
17
|
+
if (detectRssFeed(value)) {
|
|
18
|
+
return { type: 'rss', feed: parseRssFeed(value) };
|
|
19
|
+
}
|
|
20
|
+
if (detectRdfFeed(value)) {
|
|
21
|
+
return { type: 'rdf', feed: parseRdfFeed(value) };
|
|
22
|
+
}
|
|
23
|
+
throw new Error(locales.unrecognized);
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/common/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAE1D,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAQlC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAc,EAAQ,EAAE;IAC5C,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,CAAA;IACrD,CAAC;IAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,CAAA;IACrD,CAAC;IAED,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAA;IACnD,CAAC;IAED,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAA;IACnD,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;AACvC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ParseFunction, Unreliable } from './types';
|
|
2
|
+
export declare const isObject: (value: Unreliable) => value is Record<string, Unreliable>;
|
|
3
|
+
export declare const isNonEmptyObject: (value: Unreliable) => value is Record<string, Unreliable>;
|
|
4
|
+
export declare const hasAnyProps: <T extends Record<string, Unreliable>, K extends keyof T>(value: T, props: Array<K>) => boolean;
|
|
5
|
+
export declare const hasAllProps: <T extends Record<string, Unreliable>, K extends keyof T>(value: T, props: Array<K>) => boolean;
|
|
6
|
+
export declare const isNonEmptyStringOrNumber: (value: Unreliable) => value is string | number;
|
|
7
|
+
export declare const omitUndefinedFromObject: <T extends Record<string, unknown>>(object: T) => Partial<T>;
|
|
8
|
+
export declare const omitNullishFromArray: <T>(array: Array<T | null | undefined>) => Array<T>;
|
|
9
|
+
export declare const stripCdata: (text: Unreliable) => any;
|
|
10
|
+
export declare const parseString: ParseFunction<string>;
|
|
11
|
+
export declare const parseNumber: ParseFunction<number>;
|
|
12
|
+
export declare const parseBoolean: ParseFunction<boolean>;
|
|
13
|
+
export declare const parseSingular: <T>(value: T | Array<T>) => T;
|
|
14
|
+
export declare const parseArray: ParseFunction<Array<Unreliable>>;
|
|
15
|
+
export declare const parseArrayOf: <R>(value: Unreliable, parse: ParseFunction<R>) => Array<R> | undefined;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { decodeHTML } from 'entities';
|
|
2
|
+
export const isObject = (value) => {
|
|
3
|
+
return (value !== null &&
|
|
4
|
+
typeof value === 'object' &&
|
|
5
|
+
!Array.isArray(value) &&
|
|
6
|
+
Object.getPrototypeOf(value) === Object.prototype);
|
|
7
|
+
};
|
|
8
|
+
export const isNonEmptyObject = (value) => {
|
|
9
|
+
if (!isObject(value)) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
for (const key in value) {
|
|
13
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
export const hasAnyProps = (value, props) => {
|
|
20
|
+
for (const prop of props) {
|
|
21
|
+
if (value[prop] !== undefined) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
};
|
|
27
|
+
export const hasAllProps = (value, props) => {
|
|
28
|
+
for (const prop of props) {
|
|
29
|
+
if (value[prop] === undefined) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
35
|
+
export const isNonEmptyStringOrNumber = (value) => {
|
|
36
|
+
return value !== '' && (typeof value === 'string' || typeof value === 'number');
|
|
37
|
+
};
|
|
38
|
+
export const omitUndefinedFromObject = (object) => {
|
|
39
|
+
const result = {};
|
|
40
|
+
for (const key in object) {
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(object, key) && object[key] !== undefined) {
|
|
42
|
+
result[key] = object[key];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
export const omitNullishFromArray = (array) => {
|
|
48
|
+
return array.filter((item) => item !== null && item !== undefined);
|
|
49
|
+
};
|
|
50
|
+
export const stripCdata = (text) => {
|
|
51
|
+
if (typeof text !== 'string' || text.indexOf('<![CDATA[') === -1) {
|
|
52
|
+
return text;
|
|
53
|
+
}
|
|
54
|
+
return text.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, (_, content) => content || '');
|
|
55
|
+
};
|
|
56
|
+
export const parseString = (value) => {
|
|
57
|
+
if (typeof value === 'number') {
|
|
58
|
+
return value.toString();
|
|
59
|
+
}
|
|
60
|
+
if (typeof value === 'string') {
|
|
61
|
+
return decodeHTML(stripCdata(value).trim());
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export const parseNumber = (value) => {
|
|
65
|
+
if (typeof value === 'number') {
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
if (typeof value === 'string') {
|
|
69
|
+
// TODO: Maybe use the strnum package instead? It's already included with fast-xml-parser.
|
|
70
|
+
const numeric = Number(value);
|
|
71
|
+
return Number.isNaN(numeric) ? undefined : numeric;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
export const parseBoolean = (value) => {
|
|
75
|
+
if (typeof value === 'boolean') {
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
if (value === 'true') {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
if (value === 'false') {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
export const parseSingular = (value) => {
|
|
86
|
+
return Array.isArray(value) ? value[0] : value;
|
|
87
|
+
};
|
|
88
|
+
export const parseArray = (value) => {
|
|
89
|
+
if (Array.isArray(value)) {
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
if (!isObject(value)) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (value.length) {
|
|
96
|
+
return Array.from(value);
|
|
97
|
+
}
|
|
98
|
+
const keys = Object.keys(value);
|
|
99
|
+
if (keys.length === 0) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
for (let i = 0; i < keys.length; i++) {
|
|
103
|
+
const key = keys[i];
|
|
104
|
+
const n = Number(key);
|
|
105
|
+
if (!Number.isInteger(n) || n !== i) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return Object.values(value);
|
|
110
|
+
};
|
|
111
|
+
export const parseArrayOf = (value, parse) => {
|
|
112
|
+
const array = parseArray(value);
|
|
113
|
+
if (array) {
|
|
114
|
+
return omitNullishFromArray(array.map(parse));
|
|
115
|
+
}
|
|
116
|
+
const parsed = parse(value);
|
|
117
|
+
return parsed ? [parsed] : undefined;
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/common/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAGrC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAiB,EAAuC,EAAE;IACjF,OAAO,CACL,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,QAAQ;QACzB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACrB,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,MAAM,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