diff --git a/__tests__/src/eventHandlers-test.js b/__tests__/src/eventHandlers-test.js index a3899e9..c83a503 100644 --- a/__tests__/src/eventHandlers-test.js +++ b/__tests__/src/eventHandlers-test.js @@ -1,6 +1,5 @@ /* eslint-env mocha */ import assert from 'assert'; -import includes from 'array-includes'; import eventHandlers, { eventHandlersByType } from '../../src/eventHandlers'; describe('eventHandlers', () => { @@ -75,7 +74,7 @@ describe('eventHandlers', () => { 'onAnimationEnd', 'onAnimationIteration', 'onTransitionEnd', - ].every((handlerName) => includes(eventHandlers, handlerName))); + ].every((handlerName) => eventHandlers.includes(handlerName))); }); }); diff --git a/__tests__/src/getProp-parser-test.js b/__tests__/src/getProp-parser-test.js index 531a08e..7185a36 100644 --- a/__tests__/src/getProp-parser-test.js +++ b/__tests__/src/getProp-parser-test.js @@ -1,7 +1,5 @@ /* eslint-env mocha */ import assert from 'assert'; -import entries from 'object.entries'; -import fromEntries from 'object.fromentries'; import { getOpeningElement, setParserName, fallbackToBabylon } from '../helper'; import getProp from '../../src/getProp'; @@ -172,5 +170,5 @@ function adjustLocationsRecursively(node, { startOffset, endOffset }) { } function mapValues(o, f) { - return fromEntries(entries(o).map(([k, v]) => [k, f(v)])); + return Object.fromEntries(Object.entries(o).map(([k, v]) => [k, f(v)])); } diff --git a/package.json b/package.json index 6ed3c13..d464df9 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,6 @@ "jest": "^20.0.4", "jest-cli": "^20.0.4", "npmignore": "^0.3.0", - "object.entries": "^1.1.6", - "object.fromentries": "^2.0.6", "rimraf": "^2.7.1", "safe-publish-latest": "^2.0.0" }, @@ -61,12 +59,6 @@ "url": "https://github.com/jsx-eslint/jsx-ast-utils" }, "license": "MIT", - "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "object.assign": "^4.1.4", - "object.values": "^1.1.6" - }, "auto-changelog": { "output": "CHANGELOG.md", "template": "keepachangelog", diff --git a/src/eventHandlers.js b/src/eventHandlers.js index dff8a50..cb3a44c 100644 --- a/src/eventHandlers.js +++ b/src/eventHandlers.js @@ -1,6 +1,3 @@ -import flat from 'array.prototype.flat'; -import values from 'object.values'; - /** * Common event handlers for JSX element event binding. */ @@ -105,6 +102,6 @@ const eventHandlersByType = { ], }; -export default flat(values(eventHandlersByType)); +export default Object.values(eventHandlersByType).flat(); export { eventHandlersByType }; diff --git a/src/values/expressions/ObjectExpression.js b/src/values/expressions/ObjectExpression.js index 383b569..d9bd5af 100644 --- a/src/values/expressions/ObjectExpression.js +++ b/src/values/expressions/ObjectExpression.js @@ -1,5 +1,3 @@ -import assign from 'object.assign'; - /** * Extractor function for an ObjectExpression type value node. * An object expression is using {}. @@ -13,10 +11,10 @@ export default function extractValueFromObjectExpression(value) { // Support types: SpreadProperty and ExperimentalSpreadProperty if (/^(?:Experimental)?Spread(?:Property|Element)$/.test(property.type)) { if (property.argument.type === 'ObjectExpression') { - return assign({}, obj, extractValueFromObjectExpression(property.argument)); + return { ...obj, ...extractValueFromObjectExpression(property.argument) }; } } else { - return assign({}, obj, { [getValue(property.key)]: getValue(property.value) }); + return { ...obj, [getValue(property.key)]: getValue(property.value) }; } return obj; }, {});