0.4.1 • Published 7 years ago

js-sdk-objects v0.4.1

Weekly downloads
2
License
Unlicense
Repository
github
Last release
7 years ago

js-sdk-objects

Simple objects utilities.

library

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

0.4.1

7 years ago

0.3.1

7 years ago