Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 27, 2020
1 parent 414e4be commit bf01125
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
9 changes: 3 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ function rehypeReact(options) {

if (node.type === 'root') {
// Invert <https://github.com/syntax-tree/hast-to-hyperscript/blob/d227372/index.js#L46-L56>.
if (
result =
result.type === 'div' &&
(node.children.length !== 1 || node.children[0].type !== 'element')
) {
result = result.props.children
} else {
result = [result]
}
? result.props.children
: [result]

return createElement(Fragment || 'div', {}, result)
}
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,26 @@
},
"devDependencies": {
"@types/hyperscript": "0.0.4",
"@types/react": "^16.9.0",
"@types/react": "^17.0.0",
"@types/virtual-dom": "^2.1.0",
"dtslint": "^3.6.3",
"hastscript": "^5.0.0",
"hyperscript": "^2.0.2",
"dtslint": "^4.0.0",
"hastscript": "^6.0.0",
"hyperscript": "^2.0.0",
"nyc": "^15.0.0",
"prettier": "^2.0.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"remark": "^12.0.0",
"remark-cli": "^8.0.0",
"remark-preset-wooorm": "^7.0.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"remark": "^13.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"tape": "^5.0.0",
"unified": "^9.0.0",
"unist-builder": "^2.0.0",
"vue": "^2.6.0",
"xo": "^0.32.0"
"xo": "^0.36.0"
},
"scripts": {
"format": "remark . -qfo && prettier . --write && xo --fix",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test.js",
"test-types": "dtslint types",
Expand Down
4 changes: 1 addition & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ declare namespace rehypeReact {
/**
* Override default elements (such as `<a>`, `<p>`, etcetera) by passing an object mapping tag names to components
*/
components?: {
[element: string]: ComponentLike<ReturnType<H>>
}
components?: Record<string, ComponentLike<ReturnType<H>>>

/**
* React key prefix
Expand Down

0 comments on commit bf01125

Please sign in to comment.