Skip to content

Commit 9eff1e9

Browse files
committed
Refactor things
1 parent 35be79d commit 9eff1e9

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.nyc_output/
21
coverage/
32
node_modules/
43
*.log

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
"contributors": [
2828
"Titus Wormer <[email protected]> (https://wooorm.com)"
2929
],
30+
"sideEffects": false,
3031
"type": "module",
31-
"module": "./index.js",
32+
"main": "index.js",
3233
"files": [
3334
"index.js"
3435
],
@@ -38,18 +39,17 @@
3839
},
3940
"devDependencies": {
4041
"acorn": "^8.0.0",
41-
"c8": "^7.5.0",
42-
"nyc": "^15.0.0",
42+
"c8": "^7.0.0",
4343
"prettier": "^2.0.0",
4444
"remark-cli": "^9.0.0",
4545
"remark-preset-wooorm": "^8.0.0",
4646
"tape": "^5.0.0",
47-
"xo": "^0.37.0"
47+
"xo": "^0.39.0"
4848
},
4949
"scripts": {
5050
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
51-
"test-api": "node test",
52-
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --experimental-modules test.js",
51+
"test-api": "node test.js",
52+
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js",
5353
"test": "npm run format && npm run test-coverage"
5454
},
5555
"prettier": {
@@ -62,7 +62,6 @@
6262
},
6363
"xo": {
6464
"prettier": true,
65-
"ignores": [],
6665
"rules": {
6766
"no-var": "off",
6867
"prefer-arrow-callback": "off"

readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ This makes sure nodes are plain JSON, adds unist positions, normalizes
1717

1818
## Install
1919

20+
This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):
21+
Node 12+ is needed to use it and it must be `import`ed instead of `require`d.
22+
2023
[npm][]:
2124

2225
```sh
2326
npm install esast-util-from-estree
2427
```
2528

26-
Note that this package is ESM only: it must be imported instead of required.
27-
2829
## Use
2930

3031
```js
@@ -73,8 +74,7 @@ Yields:
7374

7475
## API
7576

76-
`esast-util-from-estree` exports the following identifiers:
77-
[`fromEstree`](#fromestreeestree-options).
77+
This package exports the following identifiers: `fromEstree`.
7878
There is no default export.
7979

8080
### `fromEstree(estree, options?)`

test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,16 @@ test('esast-util-from-estree', function (t) {
9393
['0B1n', 'bin, cap'],
9494
['0b1n', 'bin, low']
9595
]
96+
var index = -1
9697

97-
bigInts.forEach((d) => {
98+
while (++index < bigInts.length) {
9899
t.deepEqual(
99-
fromEstree(parse(d[0], {locations: true})).body[0].expression.bigint,
100+
fromEstree(parse(bigInts[index][0], {locations: true})).body[0].expression
101+
.bigint,
100102
'1',
101-
'should transform and normalize bigints (`' + d[1] + '`)'
103+
'should transform and normalize bigints (`' + bigInts[index][1] + '`)'
102104
)
103-
})
105+
}
104106

105107
t.end()
106108
})

0 commit comments

Comments
 (0)