Skip to content

Commit

Permalink
[Refactor] remove object.fromentries
Browse files Browse the repository at this point in the history
node 12+ has a working version
  • Loading branch information
ljharb committed Jan 30, 2024
1 parent 44394d4 commit a3c0ffa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion __mocks__/genInteractives.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
*/

import { dom, roles } from 'aria-query';
import fromEntries from 'object.fromentries';

import JSXAttributeMock from './JSXAttributeMock';
import JSXElementMock from './JSXElementMock';

import type { JSXAttributeMockType } from './JSXAttributeMock';
import type { JSXElementMockType } from './JSXElementMock';

const { fromEntries } = Object;

const domElements = [...dom.keys()];
const roleNames = [...roles.keys()];

Expand Down
4 changes: 2 additions & 2 deletions __tests__/__util__/ruleOptionsMapperFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* @flow
*/

import entries from 'object.entries';
import flatMap from 'array.prototype.flatmap';
import fromEntries from 'object.fromentries';

const { fromEntries, entries } = Object;

type ESLintTestRunnerTestCase = {
code: string,
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"jsx-ast-utils": "^3.3.5",
"language-tags": "^1.0.9",
"minimatch": "^3.1.2",
"object.fromentries": "^2.0.8",
"safe-regex-test": "^1.0.3"
},
"peerDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/util/getSuggestion.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import editDistance from 'damerau-levenshtein';
import fromEntries from 'object.fromentries';

const { fromEntries } = Object;

// Minimum edit distance to be considered a good suggestion.
const THRESHOLD = 2;
Expand Down

0 comments on commit a3c0ffa

Please sign in to comment.