Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace lodash.pullAll and lodash.union #4386

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading