Replace x instanceof Array with Array.isArray(x)

This commit is contained in:
Barney Carroll 2016-11-24 09:21:27 +00:00
parent 106a9720d1
commit d82d337569
10 changed files with 32 additions and 34 deletions

View file

@ -23,7 +23,7 @@ module.exports = function($window, Promise) {
}
return promise
}
function request(args, extra) {
return finalize(new Promise(function(resolve, reject) {
if (typeof args === "string") {
@ -136,7 +136,7 @@ module.exports = function($window, Promise) {
function cast(type, data) {
if (typeof type === "function") {
if (data instanceof Array) {
if (Array.isArray(data)) {
for (var i = 0; i < data.length; i++) {
data[i] = new type(data[i])
}