Skip to content

Commit c7cb7db

Browse files
committed
[Refactor] remove object.fromentries
node 12+ has a working version
1 parent 874732b commit c7cb7db

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

__mocks__/genInteractives.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
*/
44

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

87
import JSXAttributeMock from './JSXAttributeMock';
98
import JSXElementMock from './JSXElementMock';
109

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

13+
const { fromEntries } = Object;
14+
1415
const domElements = [...dom.keys()];
1516
const roleNames = [...roles.keys()];
1617

__tests__/__util__/ruleOptionsMapperFactory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* @flow
33
*/
44

5-
import entries from 'object.entries';
65
import flatMap from 'array.prototype.flatmap';
7-
import fromEntries from 'object.fromentries';
6+
7+
const { fromEntries, entries } = Object;
88

99
type ESLintTestRunnerTestCase = {
1010
code: string,

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
"jsx-ast-utils": "^3.3.5",
8888
"language-tags": "^1.0.9",
8989
"minimatch": "^3.1.2",
90-
"object.fromentries": "^2.0.8",
9190
"safe-regex-test": "^1.0.3"
9291
},
9392
"peerDependencies": {

src/util/getSuggestion.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import editDistance from 'damerau-levenshtein';
2-
import fromEntries from 'object.fromentries';
2+
3+
const { fromEntries } = Object;
34

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

0 commit comments

Comments
 (0)