Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.default('lineWidth',-1)
.number('maxAliasCount')
.default('maxAliasCount',100)
.describe('maxAliasCount','maximum YAML aliases allowed')
.help()
.version()
.argv;
let s = fs.readFileSync(argv.infile,'utf8');
let obj = yaml.parse(s, {maxAliasCount: argv.maxAliasCount});
let res = openapiFilter.filter(obj,argv);
if (argv.infile.indexOf('.json')>=0) {
s = JSON.stringify(res,null,2);
}
else {
strOptions.fold.lineWidth = argv.lineWidth;
s = yaml.stringify(res);
}
if (argv.outfile) {
fs.writeFileSync(argv.outfile,s,'utf8');
}
else {
console.log(s);
}
static dump(manifest) {
strOptions.fold.lineWidth = 90
strOptions.defaultType = 'PLAIN'
return yaml.stringify(manifest.toJS())
}