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

refactor: replace LoDash isPlainObject, mapValues, and isMap #1963

Merged
merged 2 commits into from Mar 31, 2020

Conversation

mastermatt
Copy link
Member

Ref: #1285

lib/common.js Outdated Show resolved Hide resolved
while (Object.getPrototypeOf(proto) !== null) {
proto = Object.getPrototypeOf(proto)
}
return Object.getPrototypeOf(value) === proto
Copy link
Member

Choose a reason for hiding this comment

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

This seems more complex than necessary, though it’s definitely not a breaking change. I’m fine with it.

Copy link
Member Author

Choose a reason for hiding this comment

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

The related LD PR lodash/lodash#3483.

@mastermatt
Copy link
Member Author

@paulmelnikow I swapped out lodash for lodash.set.

- `isMap` was added to `util.types` in Node 10.0.
  https://nodejs.org/api/util.html#util_util_types_ismap_value
- `isPlainObject` and `mapValue` both came from LoDash's master branch, which is the pending v5.
- Replace LoDash dependency with `lodash.set` to cover the one use we still have.

Ref: nock#1285
@mastermatt mastermatt changed the base branch from master to beta March 29, 2020 19:25
@mastermatt mastermatt merged commit 11b76f8 into nock:beta Mar 31, 2020
@mastermatt mastermatt deleted the 1285/isplainobject-mapvalue branch March 31, 2020 03:09
@github-actions
Copy link

github-actions bot commented Apr 4, 2020

🎉 This PR is included in version 13.0.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 13.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 13.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@@ -24,7 +24,7 @@
"dependencies": {
"debug": "^4.1.0",
"json-stringify-safe": "^5.0.1",
"lodash": "^4.17.13",
"lodash.set": "^4.3.2",
Copy link

@tusbar tusbar Jun 29, 2020

Choose a reason for hiding this comment

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

These mono-function lodash packages are deprecated.

They should not be used – and they will be removed in v5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants