https://github.com/marvinhagemeister/json-utils-optimized
Extremly optimized utils when dealing with plain javascript objects
https://github.com/marvinhagemeister/json-utils-optimized
json jsonutil
Last synced: about 1 month ago
JSON representation
Extremly optimized utils when dealing with plain javascript objects
- Host: GitHub
- URL: https://github.com/marvinhagemeister/json-utils-optimized
- Owner: marvinhagemeister
- License: mit
- Created: 2017-01-05T09:33:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-22T08:38:04.000Z (over 9 years ago)
- Last Synced: 2025-06-08T14:04:10.514Z (about 1 year ago)
- Topics: json, jsonutil
- Language: TypeScript
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# JSON utils
Useful helper functions that are highly optimized for V8. For example `deepMerge`
is about 5-7% faster than [lodash.merge](https://www.npmjs.com/package/lodash.merge).
## Usage
```bash
# npm
npm install json-utils-optimized
# or yarn
yarn install json-utils-optimized
```
## API
### `deepMerge(...objs)`
Deeply merge an arbitrary number of plain objects.
### `protoMerge(a, b)`
Shallow merge `a` into `b` by swapping prototype references. This is a lot faster than
the native `Object.assign`. Note that this should only be used when you
have full control over both objects.
### `getKeyByValue(obj, value)`
Get an objects key by its value. Only works on shallow objects.
## License
MIT, see `LICENSE.md`.