Skip to content

Commit 212f14a

Browse files
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
1 parent 3d0a607 commit 212f14a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

bin/swagger-tools

+7-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ var path = require('path');
3535
var pkg = require('../package.json');
3636
var program = require('commander');
3737
var request = require('superagent');
38-
var S = require('string');
3938
var YAML = require('js-yaml');
4039

40+
String.prototype.padRight = function (length) {
41+
var pad = Array(256).join(' ');
42+
return (this + pad).substring(0, length);
43+
};
44+
4145
var exitWithError = function (msg) {
4246
console.error();
4347
console.error(' error: ' + msg);
@@ -222,8 +226,8 @@ program
222226
console.log('Swagger ' + version + ' Information:');
223227
console.log();
224228

225-
console.log(' ' + S('documentation url').padRight(paddingAmount).s + spec.docsUrl);
226-
console.log(' ' + S('schema(s) url').padRight(paddingAmount).s + spec.schemasUrl);
229+
console.log(' ' + 'documentation url'.padRight(paddingAmount) + spec.docsUrl);
230+
console.log(' ' + 'schema(s) url'.padRight(paddingAmount) + spec.schemasUrl);
227231
console.log();
228232
});
229233

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
"qs": "^6.0.3",
8080
"serve-static": "^1.10.0",
8181
"spark-md5": "^3.0.0",
82-
"string": "^3.3.0",
8382
"superagent": "^3.5.2",
8483
"swagger-converter": "^0.1.7",
8584
"traverse": "^0.6.6",

0 commit comments

Comments
 (0)