postman-collection
Advanced tools
Comparing version 3.0.8 to 3.0.9
# Postman Collection SDK Changelog | ||
#### v3.0.9 (May 16, 2018) | ||
* Faster `QueryParam~unparse` | ||
* `Variable~toString` now stringifies falsy values instead of falling back to empty string | ||
* `Response~mimeInfo` now computes filename from `content-disposition` header | ||
* Updated dependencies | ||
#### v3.0.8 (March 21, 2018) | ||
@@ -4,0 +10,0 @@ * :arrow_up: Updated dependencies |
var _ = require('../util').lodash, | ||
marked = require('8fold-marked'), | ||
marked = require('marked'), | ||
sanitizeHtml = require('sanitize-html'), | ||
@@ -4,0 +4,0 @@ escapeHtml = require('escape-html'), |
@@ -151,14 +151,14 @@ var _ = require('../util').lodash, | ||
var str, | ||
encode = options && options.encode, | ||
ignoreDisabled = options && options.ignoreDisabled; | ||
// Convert hash maps to an array of params | ||
// @todo: Consider stringifying here directly and bailing out for better performance | ||
if (!_.isArray(params) && !PropertyList.isPropertyList(params)) { | ||
params = _.transform(params, function (accumulator, value, key) { | ||
accumulator.push({ key: key, value: value }); | ||
}, []); | ||
return _.reduce(params, function (result, value, key) { | ||
result && (result += AMPERSAND); | ||
return result + QueryParam.unparseSingle({ key: key, value: value }, encode); | ||
}, EMPTY); | ||
} | ||
var str, | ||
encode = options && options.encode, | ||
ignoreDisabled = options && options.ignoreDisabled; | ||
// construct a query parameter string from the list, with considerations for disabled values | ||
@@ -165,0 +165,0 @@ str = params.reduce(function (result, param) { |
var util = require('../util'), | ||
mimeType = require('mime-types'), | ||
filename = require('../mime-info/filename'), | ||
_ = util.lodash, | ||
fileType = require('file-type'), | ||
mimeType = require('mime-types'), | ||
mimeFormat = require('mime-format'), | ||
@@ -32,2 +33,9 @@ httpReasons = require('http-reasons'), | ||
* @const | ||
* @type {string} | ||
*/ | ||
DEFAULT_RESPONSE_FILENAME = 'response', | ||
/** | ||
* @private | ||
* @const | ||
* @type {String} | ||
@@ -68,11 +76,4 @@ */ | ||
* @const | ||
* @type {string} | ||
* @type {String} | ||
*/ | ||
DEFAULT_RESPONSE_FILENAME = 'response', | ||
/** | ||
* @private | ||
* @const | ||
* @type {string} | ||
*/ | ||
UTF8 = 'utf8', | ||
@@ -312,4 +313,4 @@ | ||
* format: normalised.format, // format specific to the type returned | ||
* name: DEFAULT_RESPONSE_FILENAME, // @todo - get from disposition | ||
* ext: mimeType.extension(normalised.source) || E, // file extension from sanitised content type | ||
* name: parsedFileName.name, // parses filename from content disposition header | ||
ext: parsedFileName.ext, // parses filename extension from content disposition header | ||
* filename: name + ext, | ||
@@ -502,3 +503,4 @@ * // also storing some meta info for possible debugging | ||
/** | ||
* @private | ||
* Extracts the mime related information from the response headers. | ||
* Looks up mime type and extracts filename from content disposition header. | ||
* | ||
@@ -509,3 +511,2 @@ * @param {String|Header} type | ||
* | ||
* @todo write unit tests | ||
*/ | ||
@@ -520,9 +521,17 @@ mimeInfo: function (type, disposition) { | ||
var normalised = mimeFormat.lookup(type), | ||
info = {}; | ||
info = {}, | ||
parsedFileName = filename.getFileNameFromDispositionHeader(disposition); | ||
// A fallback of default filename and extension from mimeType is returned, if filename is not | ||
// present in disposition header or its unparasable | ||
parsedFileName = parsedFileName || { | ||
name: DEFAULT_RESPONSE_FILENAME, | ||
ext: mimeType.extension(normalised.source) || E | ||
}; | ||
_.assign(info, { | ||
type: normalised.type, // sanitised mime type base | ||
format: normalised.format, // format specific to the type returned | ||
name: DEFAULT_RESPONSE_FILENAME, // @todo - get from disposition | ||
ext: mimeType.extension(normalised.source) || E, // file extension from sanitised content type | ||
name: parsedFileName.name, // parses filename from content disposition header | ||
ext: parsedFileName.ext, // parses filename extension from content disposition header | ||
charset: normalised.charset || UTF8, | ||
@@ -529,0 +538,0 @@ |
@@ -104,2 +104,4 @@ var _ = require('../util').lodash, | ||
/** | ||
* Returns the stringified value of the variable. | ||
* | ||
* @returns {String} | ||
@@ -109,3 +111,6 @@ */ | ||
var value = this.valueOf(); | ||
return value && _.isFunction(value.toString) ? value.toString() : E; | ||
// returns empty string if the value is | ||
// null or undefined or does not implement a toString | ||
return (!_.isNil(value) && _.isFunction(value.toString)) ? value.toString() : E; | ||
}, | ||
@@ -112,0 +117,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"author": "Postman Labs <help@getpostman.com>", | ||
"version": "3.0.8", | ||
"version": "3.0.9", | ||
"keywords": [ | ||
@@ -40,4 +40,4 @@ "postman" | ||
"liquid-json": "0.3.1", | ||
"lodash": "4.17.5", | ||
"8fold-marked": "0.3.9", | ||
"lodash": "4.17.9", | ||
"marked": "0.3.19", | ||
"mime-format": "2.0.0", | ||
@@ -52,8 +52,8 @@ "mime-types": "2.1.18", | ||
"async": "2.6.0", | ||
"browserify": "16.1.1", | ||
"btoa": "1.1.2", | ||
"chalk": "2.3.2", | ||
"browserify": "16.2.1", | ||
"btoa": "1.2.1", | ||
"chalk": "2.4.1", | ||
"dependency-check": "3.1.0", | ||
"eslint": "4.19.0", | ||
"eslint-plugin-jsdoc": "3.5.0", | ||
"eslint": "4.19.1", | ||
"eslint-plugin-jsdoc": "3.6.3", | ||
"eslint-plugin-lodash": "2.7.0", | ||
@@ -67,3 +67,3 @@ "eslint-plugin-mocha": "4.12.0", | ||
"jsdoc-to-markdown": "4.0.1", | ||
"karma": "2.0.0", | ||
"karma": "2.0.2", | ||
"karma-browserify": "5.2.0", | ||
@@ -73,3 +73,3 @@ "karma-chrome-launcher": "2.2.0", | ||
"karma-mocha-reporter": "2.2.5", | ||
"mocha": "5.0.4", | ||
"mocha": "5.1.1", | ||
"mustache": "2.3.0", | ||
@@ -80,7 +80,7 @@ "nsp": "2.8.1", | ||
"postman-jsdoc-theme": "0.0.3", | ||
"postman-request": "2.81.1-postman.4", | ||
"postman-request": "2.85.1-postman.1", | ||
"recursive-readdir": "2.2.2", | ||
"require-all": "2.2.0", | ||
"schema-compiler": "0.0.3", | ||
"shelljs": "0.8.1", | ||
"shelljs": "0.8.2", | ||
"strip-json-comments": "2.0.1", | ||
@@ -87,0 +87,0 @@ "tv4": "1.3.0", |
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
437506
9475
+ Addedmarked@0.3.19
+ Addedlodash@4.17.9(transitive)
+ Addedmarked@0.3.19(transitive)
- Removed8fold-marked@0.3.9
- Removed8fold-marked@0.3.9(transitive)
- Removedlodash@4.17.5(transitive)
Updatedlodash@4.17.9