Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/changjoo-park/nested-object-mutator
https://github.com/changjoo-park/nested-object-mutator
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/changjoo-park/nested-object-mutator
- Owner: ChangJoo-Park
- Created: 2021-01-23T02:01:10.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-25T08:01:10.000Z (almost 4 years ago)
- Last Synced: 2024-10-12T09:09:29.258Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://changjoo-park.github.io/nested-object-mutator/
- Size: 351 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Nested Object Mutator
[docs](https://changjoo-park.github.io/nested-object-mutator/)
The library for mutating deep nesting object support both Node.js and browsers.
Full builds less than ~2kb
## Installation
```bash
npm install --save nested-object-mutator
```## Usage
### Remove Nullish
```ts
import NOM from 'nested-object-mutator'const source = {
a: null,
b: {
c: undefined,
d: null
},
e: {
f: {
g: null
}
}
}const result = NOM.removeNullish(source)
// The result is `{b: {}, e: {f: {}}}`
```### Find Value using dot notation key
```ts
import NOM from 'nested-object-mutator'const source = {
a: 1,
b: {
c: 2
}
}const result = NOM.getByKey(source, "a.b.c", "." /** default delimiter is `.` can omit */)
// The result is `2`. return null if not exists.
```