immutable-js / immutable-js/immutable-js

Supporting wildcards

Open
#1,912 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
33k
Forks
1.9k
Avg merge
6d 7h
Merged PRs (30d)
1

Description

Supporting wildcards

It would be useful to be able to pass wildcards (*) in path for setIn removeIn, updateIn methods. A wildcard should match all elements in an array or all props in an object.

Example
{
    a: {
        b: 1,
        c: [
            {x: 1, y: 2}
        ]
    },
    b: {
        b: 1,
        c: [
            {x: 1, y: 2}
        ]
    }
}
deleteIn(x, ['*', 'c', 'x'])

Out

{
    a: {
        b: 1,
        c: [
            {y: 2}
        ]
    },
    b: {
        b: 1,
        c: [
            {y: 2}
        ]
    }
}

Contributor guide

Open the contributing guide

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

Start by locating the setIn, removeIn, and updateIn implementations and their existing tests. Define and test wildcard behavior for arrays and object properties, including the supplied nested example, and ensure the three methods handle the resulting paths consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.