1
0
Fork 0
forked from 0x2620/oxjs

add Function.js, some updates in OxJS

This commit is contained in:
rolux 2012-01-07 12:50:02 +05:30
commit 1db649bd61
6 changed files with 123 additions and 90 deletions

View file

@ -31,6 +31,17 @@ Ox.keyOf = function(obj, val) {
return key;
};
/*@
Ox.methods <f> Returns a sorted list of all method names of an object
> Ox.methods({a: [], b: false, f: function() {}, n: 0, o: {}, s: ''})
['f']
@*/
Ox.methods = function(obj) {
return Object.keys(obj).filter(function(key) {
return Ox.isFunction(obj[key]);
}).sort();
};
/*@
Ox.serialize <f> Parses an object into query parameters
> Ox.serialize({a: 1, b: 2, c: 3})