Replace x instanceof Array with Array.isArray(x)
This commit is contained in:
parent
106a9720d1
commit
d82d337569
10 changed files with 32 additions and 34 deletions
|
|
@ -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])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue