postman-collection
Advanced tools
Comparing version 3.4.7-beta.2 to 3.4.7-beta.3
@@ -67,4 +67,4 @@ var _ = require('../util').lodash, | ||
graphql = { | ||
query: graphql.query || EMPTY, | ||
operationName: graphql.operationName || undefined, | ||
query: graphql.query, | ||
operationName: graphql.operationName, | ||
variables: graphql.variables | ||
@@ -86,3 +86,3 @@ }; | ||
// If mode is graphql but options does not provide any content, set empty query | ||
(mode === RequestBody.MODES.graphql && !graphql) && (graphql = { query: EMPTY }); | ||
(mode === RequestBody.MODES.graphql && !graphql) && (graphql = {}); | ||
@@ -184,2 +184,4 @@ _.assign(this, /** @lends RequestBody.prototype */ { | ||
// Handle file mode | ||
// @note this is a legacy exception. ideally every individual data mode | ||
// in future would declare its "empty state". | ||
if (mode === RequestBody.MODES.file) { | ||
@@ -189,8 +191,11 @@ return !(data.src || data.content); | ||
// Handle graphql mode, send empty query anyways | ||
if (mode === RequestBody.MODES.graphql) { | ||
return !data; | ||
if (_.isString(data)) { | ||
return (data.length === 0); | ||
} | ||
return !(_.isString(data) ? data.length : (_.isFunction(data.count) && data.count())); | ||
if (_.isFunction(data.count)) { // handle for property lists | ||
return (data.count() === 0); | ||
} | ||
return _.isEmpty(data); // catch all for remaining data modes | ||
} | ||
@@ -197,0 +202,0 @@ }); |
@@ -403,3 +403,3 @@ var _ = require('../util').lodash, | ||
parse: function (url) { | ||
url = _.trim(url); | ||
url = _.trimStart(url); | ||
var pathVariables, | ||
@@ -406,0 +406,0 @@ p = { |
@@ -5,3 +5,3 @@ { | ||
"author": "Postman Labs <help@getpostman.com>", | ||
"version": "3.4.7-beta.2", | ||
"version": "3.4.7-beta.3", | ||
"keywords": [ | ||
@@ -57,3 +57,3 @@ "postman" | ||
"eslint": "5.15.3", | ||
"eslint-plugin-jsdoc": "4.5.0", | ||
"eslint-plugin-jsdoc": "4.6.0", | ||
"eslint-plugin-lodash": "5.1.0", | ||
@@ -76,3 +76,3 @@ "eslint-plugin-mocha": "5.3.0", | ||
"postman-request": "2.88.1-postman.8", | ||
"puppeteer": "1.13.0", | ||
"puppeteer": "1.14.0", | ||
"require-all": "3.0.0", | ||
@@ -79,0 +79,0 @@ "schema-compiler": "0.0.3", |
495289
74
10571