Skip to content

Commit 15610be

Browse files
authored
Lodash: Refactor away from _.pick() (#45946)
1 parent 80c68fd commit 15610be

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ module.exports = {
143143
'overEvery',
144144
'partial',
145145
'partialRight',
146+
'pick',
146147
'random',
147148
'reduce',
148149
'reject',

packages/babel-plugin-makepot/index.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434

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

@@ -182,10 +182,7 @@ function isValidTranslationKey( key ) {
182182
* @return {boolean} Whether valid translation keys match.
183183
*/
184184
function isSameTranslation( a, b ) {
185-
return isEqual(
186-
pick( a, VALID_TRANSLATION_KEYS ),
187-
pick( b, VALID_TRANSLATION_KEYS )
188-
);
185+
return VALID_TRANSLATION_KEYS.every( ( key ) => a[ key ] === b[ key ] );
189186
}
190187

191188
/**

0 commit comments

Comments
 (0)