mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-12 03:06:54 +01:00
Add support for typed arrays (#5905)
This commit is contained in:
committed by
Simon Brunel
parent
7e429a8fc6
commit
c8ce3d2018
@@ -32,13 +32,20 @@ var helpers = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if `value` is an array, else returns false.
|
||||
* Returns true if `value` is an array (including typed arrays), else returns false.
|
||||
* @param {*} value - The value to test.
|
||||
* @returns {Boolean}
|
||||
* @function
|
||||
*/
|
||||
isArray: Array.isArray ? Array.isArray : function(value) {
|
||||
return Object.prototype.toString.call(value) === '[object Array]';
|
||||
isArray: function(value) {
|
||||
if (Array.isArray && Array.isArray(value)) {
|
||||
return true;
|
||||
}
|
||||
var type = Object.prototype.toString.call(value);
|
||||
if (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user