mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
additional type-checking helpers
This commit is contained in:
parent
6d746f5dea
commit
36d09dacc7
1 changed files with 18 additions and 1 deletions
|
@ -580,13 +580,30 @@ define(function(){
|
|||
*/
|
||||
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.
|
||||
* @static
|
||||
*/
|
||||
Tone.noOp = function(){};
|
||||
|
||||
|
||||
/**
|
||||
* Make the property not writable. Internal use only.
|
||||
* @private
|
||||
|
|
Loading…
Reference in a new issue