use Ox.typeOf
This commit is contained in:
parent
80549fe4e2
commit
ec12eddfba
1 changed files with 4 additions and 3 deletions
|
@ -48,11 +48,12 @@ Ox.API = function(options, callback) {
|
|||
that[key] = function(/*data, age, callback*/) {
|
||||
var data = {}, age = -1, callback = null;
|
||||
Ox.forEach(arguments, function(argument) {
|
||||
if (Ox.isObject(argument)) {
|
||||
var type = Ox.typeOf(argument);
|
||||
if (type == 'object') {
|
||||
data = argument;
|
||||
} else if (Ox.isNumber(argument)) {
|
||||
} else if (type == 'number') {
|
||||
age = argument;
|
||||
} else if (Ox.isFunction(argument)) {
|
||||
} else if (type == 'function') {
|
||||
callback = argument;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue