The Object unit in RightJS has some pretty much standard additional methods, which provide frequently used functionalities to process objects.
empty, keys, merge, only, toQueryString, values, without
Object.empty(Object object) -> boolean
Checks if the object has any key-value pairs in it.
Object.empty({
'a':1}) // -> false
Object.empty({}) // -> true
Object.keys(Object object) -> Array keys
Collects the object keys into an array.
Object.keys({
'a':1, 'b':2, 'c':3})
// -> ['a', 'b', 'c']
Object.merge(Object o1, Object o2[, objects..]) -> Object new
Creates a new object that contains all the key-value pairs of the given objects.
Object.merge({
'a': 1, 'b': 2}, {'c': 3});
// -> {'a': 1, 'b': 2, 'c': 3}
Object.only(Object object, String key[, keys...]) -> Object new
Creates a copy of the object with only the specified key-value paris in it.
var object = {
'a': 1, 'b': 2, 'c': 3};
Object.only(object, 'b', 'c');
// -> {'b': 2, 'c': 3}
Object.toQueryString(Object object) -> String
Converts the object into a URL options string
Object.toQueryString({
a:'a', b:'b', c:'%#?'}));
// -> 'a=a&b=b&c=%25%23%3F'