https://github.com/js-sdk/js-sdk-objects
Simple object utilities.
https://github.com/js-sdk/js-sdk-objects
javascript library objects
Last synced: about 1 year ago
JSON representation
Simple object utilities.
- Host: GitHub
- URL: https://github.com/js-sdk/js-sdk-objects
- Owner: js-sdk
- Created: 2017-09-14T23:17:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-14T23:32:58.000Z (almost 9 years ago)
- Last Synced: 2025-03-04T02:25:56.138Z (over 1 year ago)
- Topics: javascript, library, objects
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Contributing: contributing.md
Awesome Lists containing this project
README
# js-sdk-objects
Simple objects utilities.
## library
```ts
$ update(f : Any -> Any, k : String, o : Object) -> Object
// Update the value of key 'k' if present.
$ updateWithKey(f : (k : String, v : Any) -> Any, k : String, o : Object) -> Object
// Update the value of key 'k' if present.
// Function 'f' will receive the pair (k, v) and must return the new value of 'k'.
$ merge(f : (k : String, vA : Any, vB : Any) -> Any, a : Object, b : Object) -> Object
// Merge 2 objects and use a function if 'k' key is present in both objects.
// NOTE: to make it recursive, just check if the values that the function
// receives are Objects and call merge on them.
```
## license
See `license.md` or visit [Unlicense](http://unlicense.org).