Skip to content

Commit db168d4

Browse files
committed
code quality improved
1 parent 9505c6f commit db168d4

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

src/core/lib/request.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function Request(options, fetchOptions) {
1717
str.push(prefix + '[]=' + obj[i]);
1818
}
1919
} else {
20-
for (p in obj) {
20+
for (const p in obj) {
2121
let k = prefix ? prefix + "[" + p + "]" : p,
2222
v = obj[p];
2323
str.push((v !== null && typeof v === "object" && p !== 'query') ?
@@ -84,6 +84,9 @@ function fetchRetry(url, headers, fetchOptions, resolve, reject, retryDelay = 30
8484
.then(() => {
8585
return fetchRetry(url, headers, retryDelay, retryLimit, fetchOptions, resolve, reject)
8686
})
87+
.catch(() => {
88+
return fetchRetry(url, headers, retryDelay, retryLimit, fetchOptions, resolve, reject)
89+
})
8790
}
8891
}
8992
fetch(url, option)

src/core/modules/assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default class Assets {
116116
query: this._query
117117
}
118118
}
119-
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
119+
var options = Utils.mergeDeep(this.fetchOptions, fetchOptions);
120120
return Utils.sendRequest(this, options);
121121
} else {
122122
console.error("Kindly provide an asset uid. e.g. .Assets('asset_uid')");

src/core/modules/entry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ export default class Entry {
357357
query: this._query
358358
}
359359
};
360-
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
360+
var options = Utils.mergeDeep(this.fetchOptions, fetchOptions);
361361
return Utils.sendRequest(this, options);
362362
} else {
363363
console.error("Kindly provide an entry uid. e.g. .Entry('asset_uid')");

src/core/modules/query.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ export default class Query extends Entry {
761761
query: this._query
762762
}
763763
};
764-
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
764+
var options = Utils.mergeDeep(this.fetchOptions, fetchOptions);
765765
return Utils.sendRequest(this, options);
766766
}
767767

src/core/stack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ export default class Stack {
364364
environment: this.environment
365365
}
366366
};
367-
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
367+
var options = Utils.mergeDeep(this.fetchOptions, fetchOptions);
368368
return Request(result, options);
369369
}
370370

@@ -518,7 +518,7 @@ export default class Stack {
518518
query: this._query
519519
}
520520
}
521-
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
521+
var options = Utils.mergeDeep(this.fetchOptions, fetchOptions);
522522
return Utils.sendRequest(this, options);
523523
}
524524

0 commit comments

Comments
 (0)