Skip to content

Commit

Permalink
Remove unnecessary lodash/cloneDeep
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsOnlyBinary committed Aug 29, 2024
1 parent 25f25f5 commit e88197b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/commands/handlers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const _ = {
each: require('lodash/each'),
map: require('lodash/map'),
cloneDeep: require('lodash/cloneDeep'),
};
const Helpers = require('../../helpers');

Expand Down Expand Up @@ -339,7 +338,7 @@ const handlers = {
whowas_cache.whowas = [];
} else {
// push the previous event prior to modifying anything
whowas_cache.whowas.push(_.cloneDeep(whois_cache));
whowas_cache.whowas.push(whois_cache);
// ensure we are starting with a clean cache for the next data
whois_cache.destroy();
whois_cache = handler.cache('whois.' + cache_key);
Expand Down Expand Up @@ -369,10 +368,10 @@ const handlers = {
// push the last one to complete the set (server returns from newest to oldest)
whowas_cache.whowas = whowas_cache.whowas || [];
if (!whois_cache.error) {
whowas_cache.whowas.push(_.cloneDeep(whois_cache));
Object.assign(whowas_cache, _.cloneDeep(whowas_cache.whowas[0]));
whowas_cache.whowas.push(whois_cache);
Object.assign(whowas_cache, whowas_cache.whowas[0]);
} else {
Object.assign(whowas_cache, _.cloneDeep(whois_cache));
Object.assign(whowas_cache, whois_cache);
}

handler.emit('whowas', whowas_cache);
Expand Down

0 comments on commit e88197b

Please sign in to comment.