Skip to content

Commit 3c00345

Browse files
authored
Replace _.uniq with native (#1687)
1 parent d9fd664 commit 3c00345

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

rules/utils/get-references.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
2-
const {uniq} = require('lodash');
2+
33
const getScopes = require('./get-scopes.js');
44

5-
const getReferences = scope => uniq(
5+
const getReferences = scope => [...new Set(
66
getScopes(scope).flatMap(({references}) => references),
7-
);
7+
)];
88

99
module.exports = getReferences;
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use strict';
2-
const {uniq} = require('lodash');
32

43
// Get identifiers of given variable
5-
module.exports = ({identifiers, references}) => uniq([
4+
module.exports = ({identifiers, references}) => [...new Set([
65
...identifiers,
76
...references.map(({identifier}) => identifier),
8-
]);
7+
])];

0 commit comments

Comments
 (0)