feature(util) add checkType

This commit is contained in:
coderaiser 2014-07-04 09:45:44 -04:00
parent bfff1224e0
commit fb8371d0cd

View file

@ -144,6 +144,22 @@
}
};
/**
* Check is type of arg with name is equal to type
*
* @param name
* @param arg
* @param type
*/
this.checkType = function(name, arg, type) {
var is = Util.getType(arg) === type;
if (!is)
throw(Error(name + ' should be ' + type));
return this;
};
/**
* Check is Properties exists and they are true if neaded
*