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/is*" and "lodash/each" with native equivalents #5043

Merged
merged 3 commits into from Jan 15, 2017
Merged

Replace "lodash/is*" and "lodash/each" with native equivalents #5043

merged 3 commits into from Jan 15, 2017

Conversation

zertosh
Copy link
Member

@zertosh zertosh commented Dec 26, 2016

No description provided.

@codecov-io
Copy link

codecov-io commented Dec 26, 2016

Current coverage is 89.21% (diff: 100%)

No coverage report found for master at 20c9dca.

Powered by Codecov. Last update 20c9dca...e18dc7a

@zertosh zertosh changed the title Replace lodash is* with equivalent typeof check Replace "lodash/is*" and "lodash/each" with native equivalents Dec 26, 2016
if (isBoolean(val)) return arrayify([val], mapFn);
if (isString(val)) return arrayify(list(val), mapFn);
if (typeof val === "boolean") return arrayify([val], mapFn);
if (typeof val === "string") return arrayify(list(val), mapFn);

Copy link
Member

@xtuc xtuc Dec 26, 2016

Choose a reason for hiding this comment

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

I prefer using

isBoolean(x)

rather than

typeof x === "boolean"

We can remove lodash but I would suggest keeping helper functions for that.

Copy link
Member

Choose a reason for hiding this comment

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

I don't have a strong opinion on that, both seems fine to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's easier to stick with typeof than helpers, so you end up with consistent code, and less nits on PRs.

Copy link
Member

Choose a reason for hiding this comment

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

I prefer typeof personally.

@@ -1,7 +1,5 @@
import isPlainObject from "lodash/isPlainObject";
import isNumber from "lodash/isNumber";
import isRegExp from "lodash/isRegExp";
Copy link
Member

Choose a reason for hiding this comment

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

isRegExp needs to be replaced as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

isRegExp doesn't have a typeof equivalent - those are the ones I'm targeting here.

Copy link
Member

Choose a reason for hiding this comment

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

Those could be replaced with instanceof RegExp in another PR

@babel-bot
Copy link
Collaborator

Hey @zertosh! It looks like one or more of your builds have failed. I've copied the relevant info below to save you some time.

OS: linux
node.js version: 5
Started at: 2017-01-15T21:28:26Z
Failed at: 2017-01-15T21:31:16Z
Logs: Click Here

OS: linux
node.js version: 4
Started at: 2017-01-15T21:28:23Z
Failed at: 2017-01-15T21:31:15Z
Logs: Click Here

OS: linux
node.js version: 0.12
Started at: 2017-01-15T21:28:42Z
Failed at: 2017-01-15T21:31:52Z
Logs: Click Here

@loganfsmyth
Copy link
Member

I rebased this to fix the conflicts, but looks like it is also having issues because our build scripts aren't transpiled and this need to be Node-4 compatible (no destructuring).

@loganfsmyth loganfsmyth merged commit 87c201f into babel:master Jan 15, 2017
@existentialism existentialism added the PR: Internal 🏠 A type of pull request used for our changelog categories label Jan 16, 2017
@zertosh
Copy link
Member Author

zertosh commented Jan 16, 2017

Thanks @loganfsmyth! Sorry about the destructuring, I had a local commit for that I never pushed :(

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants