Merging objects at the root results in a no-op
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 783
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
👋 I believe I have discovered a bug in this library based on GraphiQL usage of the library. If given:
import { dset } from "dset/merge"
let input = {};
dset(input, [], { hero: { id: "A" }});
console.log(input)
// output: {}
// expected: { hero: { id: "A" } }
In the case of GraphQL, this can happen if a field is deferred at the root level (example test case from the reference implementation).
Example commit with test case and a fix:
https://github.com/kirkbyo/dset/commit/ffc84ff8f98121cbf5df590c6917deb7936c4d52
Happy to open that commit as a PR here if you would prefer.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the dset/merge entry point and reproduce the provided JavaScript example with an empty path. Review the linked example commit for its test case and proposed behavior; done means merging into the root updates the input object as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100