Skip to content

Extremly optimized utils when dealing with plain javascript objects

License

Notifications You must be signed in to change notification settings

marvinhagemeister/json-utils-optimized

Repository files navigation

JSON utils

Useful helper functions that are highly optimized for V8. For example deepMerge is about 5-7% faster than lodash.merge.

Usage

# 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.

About

Extremly optimized utils when dealing with plain javascript objects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published