Skip to content

Commit 3f3cac5

Browse files
committed
Address issues pointed out by automated review.
1 parent 7072468 commit 3f3cac5

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

lib/rest-client.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,16 @@ module.exports = CoreObject.extend({
133133
return Promise.reject(new Error(errorMessage));
134134
}
135135

136-
var responseBody =
137-
useReleaseEndpoint && isSummaryEndpoint ? response.body.filter((rev) => rev.app === appName) : response.body;
138-
139-
// Validate that responseBody is an array
140-
if (!Array.isArray(responseBody)) {
141-
var bodyType = responseBody === null ? 'null' : typeof responseBody;
136+
if (!Array.isArray(response.body)) {
137+
var bodyType = response.body === null ? 'null' : typeof response.body;
142138
return Promise.reject(
143-
new Error('Expected array of revisions, but got ' + bodyType + ': ' + JSON.stringify(responseBody)),
139+
new Error('Expected array of revisions, but got ' + bodyType + ': ' + JSON.stringify(response.body)),
144140
);
145141
}
146142

143+
var responseBody =
144+
useReleaseEndpoint && isSummaryEndpoint ? response.body.filter((rev) => rev.app === appName) : response.body;
145+
147146
return responseBody.map(function (revision) {
148147
// ember-cli-deploy-display-revisions expects the timestamp to be either
149148
// a JS Date object or the number of milliseconds since 1970-01-01T00:00:00

0 commit comments

Comments
 (0)