janl / janl/node-jsonpointer

Setting value to undefined removes property

Open
#46 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature prs-welcome
Dominant language
JavaScript
Stars
197
Forks
29
PR merge metrics
No merged PRs in 30d

Description

I am setting a value of undefined on an object using your library, and this removes the property completely. I would like to keep the property and really set its property to undefined.

I also put an example here:

const a = {value: 5};
jsonpointer.set(a, 'value', undefined);
console.log(a); // outputs something like {}, but I would like to have {value: undefined}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the JavaScript example from the issue and inspect the library's setter behavior for an undefined value. Done means setting value to undefined leaves the value property present on the object, rather than removing it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.