hughsk / hughsk/flat

Feature request: add ability to prevent modifying certain value in `unflatten`

Open
#160 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.8k
Forks
197
PR merge metrics
No merged PRs in 30d

Description

I have a use case where I'd like to prevent the `target`'s value from being modified in `unflatten`. There's probably a number of ways to approach it but here's what I was thinking:

```js
// prevent modifying any object with a value of 'testValue'
unflatten(obj, {filter: {value: 2}})

// prevent modifying any object with a key of 'thing'
unflatten(obj, {filter: {key: 'thing'}})

// prevent modifying the object {thing: 2}
unflatten(obj, {filter: {key: 'thing', value: 2}})
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.