From bf011250b52631280acf63de0da2b29da12bd5df Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sun, 27 Dec 2020 15:36:50 +0100 Subject: [PATCH] Update dev-dependencies --- index.js | 9 +++------ package.json | 22 +++++++++++----------- types/index.d.ts | 4 +--- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/index.js b/index.js index 21a03d2..eaaba87 100644 --- a/index.js +++ b/index.js @@ -22,14 +22,11 @@ function rehypeReact(options) { if (node.type === 'root') { // Invert . - 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) } diff --git a/package.json b/package.json index cf2f857..ed8d7f0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/types/index.d.ts b/types/index.d.ts index e526fba..acf5e39 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -30,9 +30,7 @@ declare namespace rehypeReact { /** * Override default elements (such as ``, `

`, etcetera) by passing an object mapping tag names to components */ - components?: { - [element: string]: ComponentLike> - } + components?: Record>> /** * React key prefix