Skip to content

Commit aae963c

Browse files
committed
linting
1 parent 9a02ae5 commit aae963c

File tree

5 files changed

+42
-32
lines changed

5 files changed

+42
-32
lines changed

browser/swagger-client.js

Lines changed: 21 additions & 16 deletions
Large diffs are not rendered by default.

browser/swagger-client.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/client.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ var SwaggerClient = module.exports = function (url, options) {
9393
this.resourceCount = 0;
9494
this.url = null;
9595
this.useJQuery = false;
96-
this.swaggerObject = {}
96+
this.swaggerObject = {};
9797

9898
this.clientAuthorizations = new auth.SwaggerAuthorizations();
9999

@@ -184,7 +184,7 @@ SwaggerClient.prototype.build = function (mock) {
184184
}
185185

186186
self.swaggerVersion = responseObj.swaggerVersion;
187-
self.swaggerObject = responseObj
187+
self.swaggerObject = responseObj;
188188

189189
if (responseObj.swagger && parseInt(responseObj.swagger) === 2) {
190190
self.swaggerVersion = responseObj.swagger;
@@ -194,11 +194,11 @@ SwaggerClient.prototype.build = function (mock) {
194194
self.isValid = true;
195195
} else {
196196
var converter = new SwaggerSpecConverter();
197-
self.oldSwaggerObject = self.swaggerObject
197+
self.oldSwaggerObject = self.swaggerObject;
198198

199199
converter.setDocumentationLocation(self.url);
200200
converter.convert(responseObj, self.clientAuthorizations, function(spec) {
201-
self.swaggerObject = spec
201+
self.swaggerObject = spec;
202202
new Resolver().resolve(spec, self.url, self.buildFromSpec, self);
203203
self.isValid = true;
204204
});
@@ -208,7 +208,7 @@ SwaggerClient.prototype.build = function (mock) {
208208
};
209209

210210
if (this.spec) {
211-
self.swaggerObject = this.spec
211+
self.swaggerObject = this.spec;
212212
setTimeout(function () {
213213
new Resolver().resolve(self.spec, self.buildFromSpec, self);
214214
}, 10);

lib/resolver.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,9 @@ Resolver.prototype.getRefs = function(spec, obj) {
379379
obj = obj || spec;
380380
var output = {};
381381
for(var key in obj) {
382-
if (!obj.hasOwnProperty(key)) continue;
382+
if (!obj.hasOwnProperty(key)) {
383+
continue;
384+
}
383385
var item = obj[key];
384386
if(key === '$ref' && typeof item === 'string') {
385387
output[item] = null;
@@ -491,6 +493,7 @@ Resolver.prototype.resolveInline = function (root, spec, property, resolutionTab
491493
};
492494

493495
Resolver.prototype.resolveTo = function (root, property, resolutionTable, location) {
496+
var sp, i;
494497
var ref = property.$ref;
495498
var lroot = root;
496499
if (typeof ref !== 'undefined') {
@@ -507,9 +510,9 @@ Resolver.prototype.resolveTo = function (root, property, resolutionTable, locati
507510
}
508511
else if(parts[0] && parts[0].length > 0) {
509512
// relative file
510-
var sp = root.split('/');
513+
sp = root.split('/');
511514
lroot = '';
512-
for(var i = 0; i < sp.length - 1; i++) {
515+
for(i = 0; i < sp.length - 1; i++) {
513516
lroot += sp[i] + '/';
514517
}
515518
lroot += parts[0];
@@ -522,9 +525,9 @@ Resolver.prototype.resolveTo = function (root, property, resolutionTable, locati
522525
}
523526
else {
524527
// relative file
525-
var sp = root.split('/');
528+
sp = root.split('/');
526529
lroot = '';
527-
for(var i = 0; i < sp.length - 1; i++) {
530+
for(i = 0; i < sp.length - 1; i++) {
528531
lroot += sp[i] + '/';
529532
}
530533
lroot += ref;
@@ -544,10 +547,12 @@ Resolver.prototype.resolveAllOf = function(spec, obj, depth) {
544547
obj = obj || spec;
545548
var name;
546549
for(var key in obj) {
547-
if (!obj.hasOwnProperty(key)) continue;
550+
if (!obj.hasOwnProperty(key)) {
551+
continue;
552+
}
548553
var item = obj[key];
549554
if(item === null) {
550-
throw new TypeError("Swagger 2.0 does not support null types (" + obj + "). See https://github.com/swagger-api/swagger-spec/issues/229.")
555+
throw new TypeError('Swagger 2.0 does not support null types (' + obj + '). See https://github.com/swagger-api/swagger-spec/issues/229.');
551556
}
552557
if(typeof item === 'object') {
553558
this.resolveAllOf(spec, item, depth + 1);

lib/schema-markup.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function typeFromJsonSchema(type, format) {
5151
}
5252

5353
return str;
54-
};
54+
}
5555

5656
function getStringSignature(obj, baseComponent) {
5757
var str = '';
@@ -95,7 +95,7 @@ function getStringSignature(obj, baseComponent) {
9595
}
9696

9797
return str;
98-
};
98+
}
9999

100100
function schemaToJSON(schema, models, modelsToIgnore, modelPropertyMacro) {
101101
// Resolve the schema (Handle nested schemas)
@@ -104,7 +104,7 @@ function schemaToJSON(schema, models, modelsToIgnore, modelPropertyMacro) {
104104
if(typeof modelPropertyMacro !== 'function') {
105105
modelPropertyMacro = function(prop){
106106
return (prop || {}).default;
107-
}
107+
};
108108
}
109109

110110
modelsToIgnore= modelsToIgnore || {};

0 commit comments

Comments
 (0)