postman-collection-transformer
Advanced tools
Comparing version 4.1.3 to 4.1.4
#!/usr/bin/env node | ||
const fs = require('fs'), | ||
log = require('intel'), | ||
{ Command } = require('commander'), | ||
@@ -52,8 +51,2 @@ stripJSONComments = require('strip-json-comments'), | ||
// Setup logging | ||
log.basicConfig({ | ||
format: '%(date)s [%(levelname)s] %(message)s', | ||
level: log.DEBUG | ||
}); | ||
program | ||
@@ -79,6 +72,6 @@ .usage('[command] [options]') | ||
if (!options.output) { | ||
return log.error('Output file must be specified!'); | ||
return console.error('Output file must be specified!'); | ||
} | ||
if (!options.input) { | ||
return log.error('Input file must be specified!'); | ||
return console.error('Input file must be specified!'); | ||
} | ||
@@ -90,3 +83,3 @@ | ||
catch (e) { | ||
return log.error('Unable to load the input file!', e); | ||
return console.error('Unable to load the input file!', e); | ||
} | ||
@@ -96,3 +89,3 @@ | ||
if (err) { | ||
return log.error('Unable to convert the input:', err); | ||
return console.error('Unable to convert the input:', err); | ||
} | ||
@@ -102,3 +95,3 @@ | ||
if (error) { | ||
log.error('Could not create output file %s', options.output, error); | ||
console.error('Could not create output file %s', options.output, error); | ||
} | ||
@@ -119,4 +112,4 @@ }); | ||
.action((options) => { | ||
if (!options.input) { return log.error('Input file must be specified!'); } | ||
if (!options.output) { return log.error('Output file must be specified!'); } | ||
if (!options.input) { return console.error('Input file must be specified!'); } | ||
if (!options.output) { return console.error('Output file must be specified!'); } | ||
@@ -126,9 +119,9 @@ let input; | ||
try { input = loadJSON(options.input); } | ||
catch (e) { return log.error('Unable to load the input file!', e); } | ||
catch (e) { return console.error('Unable to load the input file!', e); } | ||
return transformer.normalize(input, options, (err, result) => { | ||
if (err) { return log.error('Unable to convert the input: ', err); } | ||
if (err) { return console.error('Unable to convert the input: ', err); } | ||
return writeJSON(result, options, (error) => { | ||
error && log.error('Could not create output file %s', options.output, error); | ||
error && console.error('Could not create output file %s', options.output, error); | ||
}); | ||
@@ -135,0 +128,0 @@ }); |
@@ -182,3 +182,9 @@ /* eslint-disable object-shorthand */ | ||
// return the objectified URL only if query param or path variable descriptions are present, string otherwise | ||
return (parsed.query || parsed.variable) ? parsed : (parsed.raw || requestV1.url); | ||
return (parsed.query || parsed.variable) ? | ||
parsed : ( | ||
parsed.raw || ( | ||
// avoid unnecessary empty string for null or undefined input | ||
_.isNil(requestV1.url) ? undefined : String(requestV1.url) | ||
) | ||
); | ||
}, | ||
@@ -185,0 +191,0 @@ |
{ | ||
"name": "postman-collection-transformer", | ||
"version": "4.1.3", | ||
"version": "4.1.4", | ||
"description": "Perform rapid conversation and validation of JSON structure between Postman Collection Format v1 and v2", | ||
@@ -35,5 +35,4 @@ "author": "Postman Inc.", | ||
"dependencies": { | ||
"commander": "8.0.0", | ||
"commander": "8.3.0", | ||
"inherits": "2.0.4", | ||
"intel": "1.2.0", | ||
"lodash": "4.17.21", | ||
@@ -44,18 +43,18 @@ "semver": "7.3.5", | ||
"devDependencies": { | ||
"async": "^3.2.0", | ||
"async": "^3.2.1", | ||
"browserify": "^17.0.0", | ||
"chai": "^4.3.4", | ||
"chalk": "^4.1.0", | ||
"chalk": "^4.1.2", | ||
"eslint": "^7.22.0", | ||
"eslint-plugin-jsdoc": "^35.4.1", | ||
"eslint-plugin-lodash": "^7.2.0", | ||
"eslint-plugin-jsdoc": "^36.1.1", | ||
"eslint-plugin-lodash": "^7.3.0", | ||
"eslint-plugin-mocha": "^9.0.0", | ||
"eslint-plugin-security": "^1.4.0", | ||
"js-yaml": "^4.0.0", | ||
"karma": "^6.2.0", | ||
"karma-browserify": "^8.0.0", | ||
"karma": "^6.3.5", | ||
"karma-browserify": "^8.1.0", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-mocha": "^2.0.1", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"mocha": "^9.0.1", | ||
"mocha": "^9.1.3", | ||
"nyc": "^15.1.0", | ||
@@ -62,0 +61,0 @@ "packity": "^0.3.2", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
187072
5
+ Addedcommander@8.3.0(transitive)
- Removedintel@1.2.0
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedcommander@8.0.0(transitive)
- Removeddbug@0.4.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedintel@1.2.0(transitive)
- Removedstack-trace@0.0.10(transitive)
- Removedstrftime@0.10.3(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedsymbol@0.3.1(transitive)
- Removedutcstring@0.1.0(transitive)
Updatedcommander@8.3.0