module.exports = Utils; /** * Misc utility functions * @class Utils * @constructor */ function Utils(){}; /** * Append the values in array b to the array a. See this for an explanation. * @method appendArray * @static * @param {Array} a * @param {Array} b */ Utils.appendArray = function(a,b){ if (b.length < 150000) { a.push.apply(a, b) } else { for (var i = 0, len = b.length; i !== len; ++i) { a.push(b[i]); } } }; /** * The array type to use for internal numeric computations. * @type {Array} * @static * @property ARRAY_TYPE */ Utils.ARRAY_TYPE = Float32Array || Array;