1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-19 10:22:30 +03:00

Use native Array.isArray when available.

This commit is contained in:
Frédéric Wang
2016-11-13 13:47:31 +01:00
committed by Matthew Hodgson
parent e7dcc06855
commit 04093692c9

View File

@@ -204,7 +204,8 @@ module.exports.isFunction = function(value) {
* @return {boolean} True if it is an array.
*/
module.exports.isArray = function(value) {
return Boolean(value && value.constructor === Array);
return Array.isArray ? Array.isArray(value) :
Boolean(value && value.constructor === Array);
};
/**