Skip to content

Commit

Permalink
refactor: Replace _.pick with native property assignment (#9937)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Matos <js.matos@sidi.org.br>
  • Loading branch information
JonasMatos0 and Jonas Matos committed Sep 13, 2021
1 parent 7cd3966 commit 6087fa3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/plugins/aws/info/getApiKeyValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ module.exports = {
})
.then((apiKeys) => {
if (apiKeys && apiKeys.length) {
info.apiKeys = apiKeys.map((apiKey) =>
_.pick(apiKey, ['name', 'value', 'description', 'customerId'])
);
info.apiKeys = apiKeys.map((apiKey) => ({
name: apiKey.name,
value: apiKey.value,
description: apiKey.description,
customerId: apiKey.customerId,
}));
}
return BbPromise.resolve();
});
Expand Down
2 changes: 2 additions & 0 deletions test/unit/lib/plugins/aws/info/getApiKeyValues.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ describe('#getApiKeyValues()', () => {
info: {
apiKeys: [
{
customerId: undefined,
description: undefined,
name: 'foo',
value: 'valueForKeyFoo',
},
Expand Down

0 comments on commit 6087fa3

Please sign in to comment.