Socket
Socket
Sign inDemoInstall

postman-collection-transformer

Package Overview
Dependencies
Maintainers
4
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postman-collection-transformer - npm Package Compare versions

Comparing version 4.1.3 to 4.1.4

27

bin/transform-collection.js
#!/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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc