forked from 0x2620/oxjs
add Function.js, some updates in OxJS
This commit is contained in:
parent
80f9a1a33d
commit
1db649bd61
6 changed files with 123 additions and 90 deletions
|
|
@ -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})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue