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
parent 6f79a3107b
commit 1a27ad22a7

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);
};
/**