diff --git a/.github/workflows/node-aught.yml b/.github/workflows/node-aught.yml deleted file mode 100644 index 784a031..0000000 --- a/.github/workflows/node-aught.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Tests: node.js < 10' - -on: [pull_request, push] - -jobs: - tests: - uses: ljharb/actions/.github/workflows/node.yml@main - with: - range: '>= 4 < 10' - type: minors - command: npm run tests-only - skip-ls-check: true - - node: - name: 'node < 10' - needs: [tests] - runs-on: ubuntu-latest - steps: - - run: 'echo tests completed' diff --git a/.github/workflows/node-tens.yml b/.github/workflows/node.yml similarity index 73% rename from .github/workflows/node-tens.yml rename to .github/workflows/node.yml index b49ceb1..b85269c 100644 --- a/.github/workflows/node-tens.yml +++ b/.github/workflows/node.yml @@ -1,4 +1,4 @@ -name: 'Tests: node.js >= 10' +name: 'Tests: node.js 18+' on: [pull_request, push] @@ -6,12 +6,12 @@ jobs: tests: uses: ljharb/actions/.github/workflows/node.yml@main with: - range: '>= 10' + range: '^18.18.0 || ^20.9.0 || >=21.1.0' type: minors command: npm run tests-only node: - name: 'node >= 10' + name: 'node 18+' needs: [tests] runs-on: ubuntu-latest steps: 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 f77b766..d464df9 100644 --- a/package.json +++ b/package.json @@ -41,13 +41,11 @@ "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" }, "engines": { - "node": ">=4.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "keywords": [ "jsx", @@ -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; }, {});