Skip to content

Commit

Permalink
Replace _.uniq with native (#1687)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jan 11, 2022
1 parent d9fd664 commit 3c00345
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions rules/utils/get-references.js
@@ -1,9 +1,9 @@
'use strict';
const {uniq} = require('lodash');

const getScopes = require('./get-scopes.js');

const getReferences = scope => uniq(
const getReferences = scope => [...new Set(
getScopes(scope).flatMap(({references}) => references),
);
)];

module.exports = getReferences;
5 changes: 2 additions & 3 deletions rules/utils/get-variable-identifiers.js
@@ -1,8 +1,7 @@
'use strict';
const {uniq} = require('lodash');

// Get identifiers of given variable
module.exports = ({identifiers, references}) => uniq([
module.exports = ({identifiers, references}) => [...new Set([
...identifiers,
...references.map(({identifier}) => identifier),
]);
])];

0 comments on commit 3c00345

Please sign in to comment.