Object Insert Issue

Open
#10 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
backend

Research direction

Start by locating the JSON.Object.insert documentation and implementation in this repository, then check how the underlying assign operation handles an existing key. The issue reports that inserting an existing key does not overwrite it; confirm the expected behavior against the documentation and add or update a focused test. Done when the implementation, documentation, and test agree on whether existing values are replaced.

Written by the indexing model from the issue text.

Description

The documentation for JSON.Object.insert states that it will overwrite values for the existing keys, but it is not overwriting, you have to delete the key manually before inserting an existing key.

I think the issue is that the underlying method used (assign) does not actually overwrite existing keys:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign

Dominant language
PureScript
Stars
17
Forks
3
Avg merge
2d 23h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from purescript/purescript-json

All issues in purescript/purescript-json

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.