Skip to content

Commit bd350b4

Browse files
committed
Update dev-dependencies
1 parent 063fd5c commit bd350b4

File tree

3 files changed

+32
-27
lines changed

3 files changed

+32
-27
lines changed

lib/atom.mjs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ export function atom(channel, data) {
1616
if (meta.title == null) throw new Error('Expected `channel.title` to be set')
1717
if (meta.url == null) throw new Error('Expected `channel.url` to be set')
1818

19-
items.push(x('title', String(meta.title)))
20-
items.push(x('subtitle', String(meta.description || '')))
2119
value = new URL(meta.url).href
22-
// `rel: 'alternate'` is the default.
23-
items.push(x('link', value))
24-
items.push(x('id', value))
25-
items.push(x('updated', now.toGMTString()))
20+
21+
items.push(
22+
x('title', String(meta.title)),
23+
x('subtitle', String(meta.description || '')),
24+
// `rel: 'alternate'` is the default.
25+
x('link', value),
26+
x('id', value),
27+
x('updated', now.toGMTString())
28+
)
2629

2730
if (meta.feedUrl) {
2831
items.push(
@@ -76,8 +79,7 @@ export function atom(channel, data) {
7679

7780
if (datum.url) {
7881
value = new URL(datum.url).href
79-
children.push(x('link', {href: value}))
80-
children.push(x('id', value))
82+
children.push(x('link', {href: value}), x('id', value))
8183
}
8284

8385
value = datum.published

lib/rss.mjs

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ export function rss(channel, data) {
1717
if (meta.title == null) throw new Error('Expected `channel.title` to be set')
1818
if (meta.url == null) throw new Error('Expected `channel.url` to be set')
1919

20-
items.push(x('title', String(meta.title)))
21-
items.push(x('description', String(meta.description || '')))
22-
items.push(x('link', new URL(meta.url).href))
23-
items.push(x('lastBuildDate', now.toGMTString()))
24-
items.push(x('dc:date', now.toISOString()))
20+
items.push(
21+
x('title', String(meta.title)),
22+
x('description', String(meta.description || '')),
23+
x('link', new URL(meta.url).href),
24+
x('lastBuildDate', now.toGMTString()),
25+
x('dc:date', now.toISOString())
26+
)
2527

2628
if (meta.feedUrl) {
2729
atom = true
@@ -36,14 +38,12 @@ export function rss(channel, data) {
3638

3739
if (meta.lang) {
3840
value = bcp47(meta.lang)
39-
items.push(x('language', value))
40-
items.push(x('dc:language', value))
41+
items.push(x('language', value), x('dc:language', value))
4142
}
4243

4344
if (meta.author) {
4445
value = '© ' + now.getUTCFullYear() + ' ' + meta.author
45-
items.push(x('copyright', value))
46-
items.push(x('dc:rights', value))
46+
items.push(x('copyright', value), x('dc:rights', value))
4747
}
4848

4949
if (meta.tags) {
@@ -79,21 +79,24 @@ export function rss(channel, data) {
7979

8080
if (datum.url) {
8181
value = new URL(datum.url).href
82-
children.push(x('link', value))
83-
84-
// Do not treat it as a URL, just an opaque identifier.
85-
// `<link>` is already used by readers for the URL.
86-
// Now, the value we have here is a URL, but we can’t know if it’s
87-
// “permanent”, so, set `false`.
88-
children.push(x('guid', {isPermaLink: 'false'}, value))
82+
children.push(
83+
x('link', value),
84+
// Do not treat it as a URL, just an opaque identifier.
85+
// `<link>` is already used by readers for the URL.
86+
// Now, the value we have here is a URL, but we can’t know if it’s
87+
// “permanent”, so, set `false`.
88+
x('guid', {isPermaLink: 'false'}, value)
89+
)
8990
}
9091

9192
value = datum.published
9293

9394
if (value != null) {
9495
if (typeof value !== 'object') value = new Date(value)
95-
children.push(x('pubDate', value.toGMTString()))
96-
children.push(x('dc:date', value.toISOString()))
96+
children.push(
97+
x('pubDate', value.toGMTString()),
98+
x('dc:date', value.toISOString())
99+
)
97100
}
98101

99102
value = datum.modified

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"remark-preset-wooorm": "^8.0.0",
4747
"tape": "^5.0.0",
4848
"xast-util-to-xml": "^2.0.0",
49-
"xo": "^0.37.0"
49+
"xo": "^0.38.0"
5050
},
5151
"scripts": {
5252
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",

0 commit comments

Comments
 (0)