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

Remove lodash.difference dependency #48

Open
Semigradsky opened this issue Oct 13, 2021 · 5 comments · May be fixed by #49
Open

Remove lodash.difference dependency #48

Semigradsky opened this issue Oct 13, 2021 · 5 comments · May be fixed by #49

Comments

@Semigradsky
Copy link

See https://lodash.com/per-method-packages for reasons for change.

I can send PR.

@ljharb
Copy link

ljharb commented Oct 13, 2021

This will dramatically increase the likelihood that an unrelated CVE will implicate this package. I strongly suggest preferring the per-method packages, and leaving it to app consumers to handle deduping with their bundler config.

@iamakulov
Copy link
Owner

iamakulov commented Oct 14, 2021

Thanks for the v5 heads-up 🙌

To be fair, I'd probably drop the lodash.difference dependency altogether and switch to a plain .filter() instead:

// Before
var unknownOptions = arrayDifference(
    Object.keys(optionsObject),
    supportedOptions
);

// After
var unknownOptions = Object.keys(optionsObject)
    .filter(function (optionName) {
        return supportedOptions.indexOf(optionName) === -1;
    });

Happy to accept a PR!

@Semigradsky
Copy link
Author

Semigradsky commented Oct 15, 2021

As I see you already use features which not supported in Node < 6.x (Array.isArray for example). So includes can be used.

@ljharb
Copy link

ljharb commented Oct 15, 2021

Array.isArray is supported in node 0.6.

@Semigradsky Semigradsky linked a pull request Oct 15, 2021 that will close this issue
@Semigradsky
Copy link
Author

Oh, I was deceived by https://node.green/

@Semigradsky Semigradsky changed the title Replace lodash.difference to lodash Remove lodash.difference dependency Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants