Skip to content

Commit 65d5a3b

Browse files
committed
more de-mangling
1 parent 866f292 commit 65d5a3b

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

lib/swagger.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,21 @@ SwaggerApi.prototype.buildFromSpec = function(response) {
128128
};
129129

130130
SwaggerApi.prototype.buildFrom1_1Spec = function(response) {
131-
var api, isApi, newName, operation, res, resource, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2;
132131
log("This API is using a deprecated version of Swagger! Please see http://github.com/wordnik/swagger-core/wiki for more info");
133-
if (response.apiVersion != null) {
132+
if (response.apiVersion != null)
134133
this.apiVersion = response.apiVersion;
135-
}
136134
this.apis = {};
137135
this.apisArray = [];
138136
this.produces = response.produces;
139137
if (response.info != null) {
140138
this.info = response.info;
141139
}
142-
isApi = false;
143-
_ref = response.apis;
144-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
145-
api = _ref[_i];
140+
var isApi = false;
141+
for (var i = 0; i < response.apis.length; i++) {
142+
var api = response.apis[i];
146143
if (api.operations) {
147-
_ref1 = api.operations;
148-
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
149-
operation = _ref1[_j];
144+
for (var j = 0; j < api.operations.length; j++) {
145+
operation = api.operations[j];
150146
isApi = true;
151147
}
152148
}
@@ -159,15 +155,14 @@ SwaggerApi.prototype.buildFrom1_1Spec = function(response) {
159155
this.basePath = this.url;
160156
}
161157
if (isApi) {
162-
newName = response.resourcePath.replace(/\//g, '');
158+
var newName = response.resourcePath.replace(/\//g, '');
163159
this.resourcePath = response.resourcePath;
164-
res = new SwaggerResource(response, this);
160+
var res = new SwaggerResource(response, this);
165161
this.apis[newName] = res;
166162
this.apisArray.push(res);
167163
} else {
168-
_ref2 = response.apis;
169-
for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
170-
resource = _ref2[_k];
164+
for (k = 0; k < response.apis.length; k++) {
165+
resource = response.apis[k];
171166
res = new SwaggerResource(resource, this);
172167
this.apis[res.name] = res;
173168
this.apisArray.push(res);

0 commit comments

Comments
 (0)