Skip to content

Commit

Permalink
Replace lodash.pullAll and lodash.union (#4386)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore authored Jan 7, 2025
1 parent 25c4aa2 commit 9597140
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
9 changes: 5 additions & 4 deletions lib/sitespeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import fs from 'node:fs/promises';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc.js';
import { getLogger } from '@sitespeed.io/log';
import pullAll from 'lodash.pullall';
import union from 'lodash.union';

import { configure } from './core/logging.js';
import { toArray } from './support/util.js';
Expand Down Expand Up @@ -103,8 +101,11 @@ export async function run(options) {
// Finalize the plugins that we wanna run
// First we add the new ones and then remove, that means remove
// always wins
pluginNames = union(pluginNames, toArray(plugins.add));
pullAll(pluginNames, toArray(plugins.remove));
pluginNames = [...new Set([...pluginNames, ...toArray(plugins.add)])];

const removeSet = new Set(toArray(plugins.remove));
pluginNames = pluginNames.filter(name => !removeSet.has(name));

if (plugins.list) {
log.info('The following plugins are enabled: %s', pluginNames.join(', '));
}
Expand Down
12 changes: 0 additions & 12 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@
"lodash.isempty": "4.4.0",
"lodash.merge": "4.6.2",
"lodash.pick": "4.4.0",
"lodash.pullall": "4.2.0",
"lodash.reduce": "4.6.0",
"lodash.set": "4.3.2",
"lodash.union": "4.6.0",
"markdown": "0.5.0",
"node-scp": "0.0.23",
"ora": "8.0.1",
Expand Down

0 comments on commit 9597140

Please sign in to comment.