use Ox.typeOf

This commit is contained in:
rolux 2012-05-25 19:46:02 +02:00
parent 80549fe4e2
commit ec12eddfba

View file

@ -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;
}
});