Skip to content

Commit

Permalink
Lodash: Refactor away from _.pick() (#45946)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Nov 25, 2022
1 parent 80c68fd commit 15610be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ module.exports = {
'overEvery',
'partial',
'partialRight',
'pick',
'random',
'reduce',
'reject',
Expand Down
7 changes: 2 additions & 5 deletions packages/babel-plugin-makepot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/

const { po } = require( 'gettext-parser' );
const { pick, isEqual, merge, isEmpty } = require( 'lodash' );
const { merge, isEmpty } = require( 'lodash' );
const { relative, sep } = require( 'path' );
const { writeFileSync } = require( 'fs' );

Expand Down Expand Up @@ -182,10 +182,7 @@ function isValidTranslationKey( key ) {
* @return {boolean} Whether valid translation keys match.
*/
function isSameTranslation( a, b ) {
return isEqual(
pick( a, VALID_TRANSLATION_KEYS ),
pick( b, VALID_TRANSLATION_KEYS )
);
return VALID_TRANSLATION_KEYS.every( ( key ) => a[ key ] === b[ key ] );
}

/**
Expand Down

0 comments on commit 15610be

Please sign in to comment.