Skip to content

Commit b00bde6

Browse files
committed
Update dependencies
1 parent 4520e77 commit b00bde6

File tree

4 files changed

+26
-28
lines changed

4 files changed

+26
-28
lines changed

index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import bcp47 from 'bcp-47-normalize'
2-
import u from 'unist-builder'
3-
import x from 'xastscript'
2+
import {u} from 'unist-builder'
3+
import {x} from 'xastscript'
44

55
var own = {}.hasOwnProperty
66

@@ -94,8 +94,10 @@ export function sitemap(data) {
9494
modified = new Date(modified)
9595
}
9696

97-
if (isNaN(modified)) {
98-
throw new Error('Unexpected incorrect date `' + entry.modified + '`')
97+
if (Number.isNaN(modified.valueOf())) {
98+
throw new TypeError(
99+
'Unexpected incorrect date `' + entry.modified + '`'
100+
)
99101
}
100102

101103
node.children.push(x('lastmod', modified.toISOString()))

package.json

+13-16
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,36 @@
2222
"contributors": [
2323
"Titus Wormer <[email protected]> (https://wooorm.com)"
2424
],
25+
"sideEffects": false,
2526
"type": "module",
26-
"module": "./index.js",
27-
"types": "types",
27+
"main": "index.js",
28+
"types": "types/",
2829
"files": [
29-
"index.js",
30-
"types/index.d.ts"
30+
"types/index.d.ts",
31+
"index.js"
3132
],
3233
"dependencies": {
3334
"@types/xast": "^1.0.0",
3435
"bcp-47-normalize": "^1.0.0",
35-
"unist-builder": "^2.0.0",
36-
"xastscript": "^2.0.0"
36+
"unist-builder": "^3.0.0",
37+
"xastscript": "^3.0.0"
3738
},
3839
"devDependencies": {
3940
"c8": "^7.0.0",
4041
"concat-stream": "^2.0.0",
41-
"dtslint": "^4.0.0",
4242
"prettier": "^2.0.0",
4343
"regenerate": "^1.0.0",
4444
"remark-cli": "^9.0.0",
4545
"remark-preset-wooorm": "^8.0.0",
4646
"tape": "^5.0.0",
47-
"xast-util-to-xml": "^2.0.0",
48-
"xo": "^0.38.0"
47+
"xast-util-to-xml": "^3.0.0",
48+
"xo": "^0.39.0"
4949
},
5050
"scripts": {
5151
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
5252
"test-api": "node test.js",
53-
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --experimental-modules test.js",
54-
"test-types": "dtslint types",
55-
"test": "npm run format && npm run test-coverage && npm run test-types"
53+
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js",
54+
"test": "npm run format && npm run test-coverage"
5655
},
5756
"prettier": {
5857
"tabWidth": 2,
@@ -64,7 +63,6 @@
6463
},
6564
"xo": {
6665
"prettier": true,
67-
"esnext": false,
6866
"rules": {
6967
"complexity": "off",
7068
"eqeqeq": [
@@ -76,9 +74,8 @@
7674
],
7775
"max-depth": "off",
7876
"no-eq-null": "off",
79-
"no-self-compare": "off",
80-
"unicorn/prefer-number-properties": "off",
81-
"unicorn/prefer-type-error": "off"
77+
"no-var": "off",
78+
"prefer-arrow-callback": "off"
8279
},
8380
"ignores": [
8481
"types"

readme.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,24 @@ You should place sitemaps in the root of your site and reference them in
3030
You might also [report](https://support.google.com/webmasters/answer/7451001)
3131
sitemap changes to Google.
3232

33-
Note that this package is ESM only: Node 12+ is required to use it and it must
34-
be imported instead of required.
35-
3633
## Install
3734

35+
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):
36+
Node 12+ is needed to use it and it must be `import`ed instead of `require`d.
37+
3838
[npm][]:
3939

4040
```sh
4141
npm install xast-util-sitemap
4242
```
4343

44-
Note that this package is ESM only: it must be imported instead of required.
45-
4644
## Use
4745

4846
Say we have the following module, `example.js`
4947

5048
```js
5149
import {sitemap} from 'xast-util-sitemap'
52-
import toXml from 'xast-util-to-xml'
50+
import {toXml} from 'xast-util-to-xml'
5351

5452
var tree = sitemap([
5553
'https://example.com/alpha/',
@@ -106,6 +104,9 @@ Now, running `node example.js` yields (pretty printed):
106104

107105
## API
108106

107+
This package exports the following identifiers: `sitemap`.
108+
There is no default export.
109+
109110
### `sitemap(data)`
110111

111112
Build a sitemap.

test.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict'
2-
31
import test from 'tape'
42
import {sitemap} from './index.js'
53

0 commit comments

Comments
 (0)