Skip to content

Commit 0997434

Browse files
committed
Updates from feedback.
1 parent 38ceb2d commit 0997434

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var utils = require('./lib/util/utils');
99
// Easy to use methods from validate.js
1010
exports.log = require('./lib/util/logging');
1111
exports.compare = validate.compare;
12+
exports.compareTags = validate.compareTags;
1213

1314
// Classes
1415
exports.OpenApiDiff = require('./lib/validators/openApiDiff');

lib/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ exports.compareTags = function (oldSwagger, oldTag, newSwagger, newTag, options)
5757
log.filepath = options.logFilepath || log.filepath;
5858
let openApiDiff = new OpenApiDiff(options);
5959

60-
return openApiDiff.compareTags(oldSwagger, oldTag, newSwagger, newTag);
60+
return openApiDiff.compare(oldSwagger, newSwagger, oldTag, newTag);
6161
};

lib/validators/openApiDiff.js

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,12 @@ class OpenApiDiff {
5151
*
5252
* @param {string} newSwagger Path to the new specification file.
5353
*
54-
*/
55-
compare(oldSwagger, newSwagger) {
56-
log.silly(`compare is being called`);
57-
58-
let self = this;
59-
var promise1 = self.processViaAutoRest(oldSwagger, 'old');
60-
var promise2 = self.processViaAutoRest(newSwagger, 'new');
61-
62-
return Promise.all([promise1, promise2]).then(results => {
63-
return self.processViaOpenApiDiff(results[0], results[1]);
64-
});
65-
}
66-
67-
/**
68-
* Compares old and new specifications.
69-
*
70-
* @param {string} oldSwagger Path to the old specification file.
71-
*
72-
* @param {string} [oldTag] Tag name used for autorest with the old specification file.
73-
*
74-
* @param {string} newSwagger Path to the new specification file.
54+
* @param {string} oldTag Tag name used for autorest with the old specification file.
7555
*
76-
* @param {string} [newTag] Tag name used for autorest with the new specification file.
56+
* @param {string} newTag Tag name used for autorest with the new specification file.
7757
*
7858
*/
79-
compareTags(oldSwagger, oldTag, newSwagger, newTag) {
59+
compare(oldSwagger, newSwagger, oldTag, newTag) {
8060
log.silly(`compare is being called`);
8161

8262
let self = this;

0 commit comments

Comments
 (0)