Skip to content

Conversation

w33ble
Copy link
Contributor

@w33ble w33ble commented Sep 22, 2017

Fixes #24

Alternative to #28

Lodash wasn't being used too heavily, so instead of leaning on babel-plugin-lodash, it was pretty easy to replace it outright. This PR adds a small utils.js file with helpers that perform the same functionality lodash was being used for, in 42 lines.

The only exception is _.reduce, which I replaced with just-reduce-object, a quite small and dependency-free library that functions the same way (with a small change in the signature of the iteratee).

Existing tests still pass locally, and I'd be willing to add tests for the code in utils.js if you'd like as well.

this module contains all the helpers that lodash was being used for, except for reduce
and remove lodash, since it's not being used anywhere else now
@petrbrzek
Copy link
Member

@w33ble nice! Would be great to add tests and I'm happy to merge it.

@w33ble
Copy link
Contributor Author

w33ble commented Sep 25, 2017

Added some basic tests for the utils. I also made isPlainObject mirror lodash's functionality exactly, although it's overkill in this use case. I can make it the simple check it was before if you'd like, but it didn't add much more code.

@petrbrzek
Copy link
Member

@w33ble It looks pretty good. Thanks a lot for your time.

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.

2 participants