Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit 51167c0

Browse files
committed
Resolve prefer-object-spread-to-lodash violations
1 parent 107bf83 commit 51167c0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,12 @@ function scan(options, redis) {
193193
.then(() => null)
194194
.catch(err => err)
195195
.then((err) => {
196-
self.write(_.extend(
197-
{ keysScanned, keysSelected },
198-
err ? { error: err.message || String(err) } : null,
199-
_.omit(options, 'password')
200-
));
196+
self.write({
197+
keysScanned,
198+
keysSelected,
199+
...err ? { error: err.message || String(err) } : null,
200+
..._.omit(options, 'password'),
201+
});
201202
self.end();
202203
return err;
203204
}));

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const deleteTestKeys = () => {
2222

2323
const extendArgs = o => (
2424
() => {
25-
const opts = _.extend({}, defaultArgs, o);
25+
const opts = { ...defaultArgs, ...o };
2626
if (opts.pattern) { opts.pattern = `${prefix}${opts.pattern}`; }
2727
return new RedisKeyScanner(opts);
2828
}

0 commit comments

Comments
 (0)