Repository navigation
fix(compat/pick): prioritize literal key over dot notation path when value is undefined - #1775
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
|
Looking at the code, I think there's probably a bug in get too (since in pick we set the value we got from get), so we should fix that as well. |
Contributor
Author
Thanks for pointing that out! I'll take a look over the weekend 👍 |
…value is undefined
…alue is undefined
Antoliny0919
force-pushed
the
fix-compat-pick
branch
from
June 23, 2026 05:03
3f3a76f to
be2d007
Compare
raon0211
added a commit
that referenced
this pull request
Jun 27, 2026
…unset (match #1775) (#1808) * fix(compat/unset): prioritize literal key over dot-notation path when value is undefined When an object has an own key containing dots (e.g. 'a.b') whose value is undefined, unset() incorrectly fell through to the deep-path branch and deleted the nested a.b instead of the literal 'a.b' key, leaving the literal key in place. This mirrors the literal-key-over-path fix applied to get()/pick() in #1775; add the same !Object.hasOwn(obj, path) guard so unset() (and omit(), which delegates to it) match lodash. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Apply suggestions from code review Co-authored-by: Sojin Park <raon0211@gmail.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Sojin Park <raon0211@gmail.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In pick, when using dot notation, a literal key matching the dot-notation path takes priority, as documented.
However, there is a bug where the literal key is ignored when its value is
undefined.Reproduce