Skip to content

Commit 70d87a2

Browse files
committed
Refactor
1 parent 920fe45 commit 70d87a2

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ function addChild(nodes, value) {
5555
addChild(nodes, value[index])
5656
}
5757
} else if (typeof value === 'object' && value.type) {
58-
if (value.type === 'root') addChild(nodes, value.children)
59-
else nodes.push(value)
58+
if (value.type === 'root') {
59+
addChild(nodes, value.children)
60+
} else {
61+
nodes.push(value)
62+
}
6063
} else {
6164
throw new TypeError('Expected node, nodes, string, got `' + value + '`')
6265
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
"@types/xast": "^1.0.0"
3535
},
3636
"devDependencies": {
37-
"@babel/core": "^7.12.3",
38-
"@babel/plugin-syntax-jsx": "^7.12.1",
39-
"@babel/plugin-transform-react-jsx": "^7.12.1",
37+
"@babel/core": "^7.0.0",
38+
"@babel/plugin-syntax-jsx": "^7.0.0",
39+
"@babel/plugin-transform-react-jsx": "^7.0.0",
4040
"buble": "^0.20.0",
4141
"dtslint": "^4.0.0",
4242
"nyc": "^15.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-
"unist-builder": "^2.0.3",
47+
"unist-builder": "^2.0.0",
4848
"xo": "^0.34.0"
4949
},
5050
"scripts": {

0 commit comments

Comments
 (0)