Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit

Permalink
Remove stringjs dependency due to vulnerability in string 3.3. It is … (
Browse files Browse the repository at this point in the history
#542)

* Remove stringjs dependency due to vulnerability in string 3.3. It is used so little there is no need for the extra dependency in Swagger-tools.

Source: CERT
Name: https://nodesecurity.io/advisories/536
Url: https://nodesecurity.io/advisories/536
Source: CERT
Name: jprichardson/string.js#212
Url: jprichardson/string.js#212

* Suggested changes.
smarusa authored and whitlockjc committed Oct 18, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 3d0a607 commit 857bf43
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 12 additions & 3 deletions bin/swagger-tools
Original file line number Diff line number Diff line change
@@ -35,9 +35,18 @@ var path = require('path');
var pkg = require('../package.json');
var program = require('commander');
var request = require('superagent');
var S = require('string');
var YAML = require('js-yaml');

var padRight = function (s, len, ch) {
if (!ch) {
ch = ' ';
}
if (s.length >= len) {
return s;
}
return s + Array(len - s.length + 1).join(ch);
};

var exitWithError = function (msg) {
console.error();
console.error(' error: ' + msg);
@@ -222,8 +231,8 @@ program
console.log('Swagger ' + version + ' Information:');
console.log();

console.log(' ' + S('documentation url').padRight(paddingAmount).s + spec.docsUrl);
console.log(' ' + S('schema(s) url').padRight(paddingAmount).s + spec.schemasUrl);
console.log(' ' + padRight('documentation url', paddingAmount) + spec.docsUrl);
console.log(' ' + padRight('schema(s) url', paddingAmount) + spec.schemasUrl);
console.log();
});

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@
"qs": "^6.0.3",
"serve-static": "^1.10.0",
"spark-md5": "^3.0.0",
"string": "^3.3.0",
"superagent": "^3.5.2",
"swagger-converter": "^0.1.7",
"traverse": "^0.6.6",

0 comments on commit 857bf43

Please sign in to comment.