additional type-checking helpers

This commit is contained in:
Yotam Mann 2015-10-11 16:04:14 -04:00
parent 6d746f5dea
commit 36d09dacc7

View file

@ -580,13 +580,30 @@ define(function(){
*/ */
Tone.prototype.isFunction = isFunction; Tone.prototype.isFunction = isFunction;
/**
* Test if the argument is a number.
* @param {*} arg the argument to test
* @returns {boolean} true if the arg is a number
*/
Tone.prototype.isNumber = function(arg){
return (typeof arg === "number");
};
/**
* Test if the argument is a boolean.
* @param {*} arg the argument to test
* @returns {boolean} true if the arg is a boolean
*/
Tone.prototype.isBoolean = function(arg){
return (typeof arg === "boolean");
};
/** /**
* An empty function. * An empty function.
* @static * @static
*/ */
Tone.noOp = function(){}; Tone.noOp = function(){};
/** /**
* Make the property not writable. Internal use only. * Make the property not writable. Internal use only.
* @private * @private