Skip to content

Replace lodash with lodash.wrap#24

Open
chrisdothtml wants to merge 1 commit into
pmowrer:masterfrom
chrisdothtml:use-lodash-wrap
Open

Replace lodash with lodash.wrap#24
chrisdothtml wants to merge 1 commit into
pmowrer:masterfrom
chrisdothtml:use-lodash-wrap

Conversation

@chrisdothtml

Copy link
Copy Markdown

Reduces the size of the dependency when installing/using it, by directly using lodash.wrap instead of loading the whole library. Also only leaves you on the hook for vulnerabilities of a single lodash util rather than all of them

Comment thread src/index.js
Comment on lines +37 to 40
jasmine.getEnv().describe = wrap(jasmine.getEnv().describe,
(describe, ...args) => {
let suite = describe.apply(null, args);
suites.push(suite);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
jasmine.getEnv().describe = wrap(jasmine.getEnv().describe,
(describe, ...args) => {
let suite = describe.apply(null, args);
suites.push(suite);
const _describe = jasmine.getEnv().describe;
jasmine.getEnv().describe = (...args) => {
let suite = _describe.apply(null, args);
suites.push(suite);

or could even take it one step further and remove lodash altogether 🤷‍♂️

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 this pull request may close these issues.

1 participant