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
Conversation
while (Object.getPrototypeOf(proto) !== null) { | ||
proto = Object.getPrototypeOf(proto) | ||
} | ||
return Object.getPrototypeOf(value) === proto |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@paulmelnikow I swapped out |
- `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
7303e86
to
b85f914
Compare
🎉 This PR is included in version 13.0.0-beta.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 13.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 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", |
There was a problem hiding this comment.
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.
isMap
was added toutil.types
in Node 10.0https://nodejs.org/api/util.html#util_util_types_ismap_value
isPlainObject
andmapValue
both came from LoDash's master branch, which is the pending v5.Ref: #1285