fix: add polyfill method for array.isArray

Closes #497
This commit is contained in:
Estevão Soares dos Santos 2022-04-03 09:36:37 +01:00
parent fc01abd708
commit 16cac70aee

View File

@ -47,7 +47,15 @@ showdown.helper.isFunction = function (a) {
*/
showdown.helper.isArray = function (a) {
'use strict';
return Array.isArray(a);
let isArray;
if (!Array.isArray) {
isArray = function (arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
} else {
isArray = Array.isArray;
}
return isArray(a);
};
/**