postman-collection
Advanced tools
Comparing version 3.4.1 to 3.4.2-beta.1
{ | ||
"concepts": { | ||
"title": "Postman SDK Concepts" | ||
}, | ||
"mutation-tracking": { | ||
"title": "Tracking Variable Mutations with Postman Collection SDK" | ||
} | ||
} |
@@ -30,9 +30,11 @@ var _ = require('../util').lodash, | ||
* @param {String} name | ||
* @param {?Object} options - Set of options | ||
* @param {?Boolean} options.excludeDisabled - When set to true, disabled events are excluded | ||
* @returns {Array<Event>} | ||
*/ | ||
listeners: function (name) { | ||
listeners: function (name, options) { | ||
var all; | ||
// we first procure all matching events from this list | ||
all = this.listenersOwn(name); | ||
all = this.listenersOwn(name, options); | ||
@@ -46,3 +48,3 @@ this.eachParent(function (parent) { | ||
(parent !== this.__parent) && EventList.isEventList(parent.events) && | ||
(parentEvents = parent.events.listenersOwn(name)) && parentEvents.length && | ||
(parentEvents = parent.events.listenersOwn(name, options)) && parentEvents.length && | ||
all.unshift.apply(all, parentEvents); // eslint-disable-line prefer-spread | ||
@@ -59,5 +61,13 @@ }, this); | ||
* @param {string} name | ||
* @param {?Object} options - Set of options | ||
* @param {?Boolean} options.excludeDisabled - When set to true, disabled events are excluded | ||
* @returns {Array<Event>} | ||
*/ | ||
listenersOwn: function (name) { | ||
listenersOwn: function (name, options) { | ||
if (options && options.excludeDisabled) { | ||
return this.filter(function (event) { | ||
return (!event.disabled && event.listen === name); | ||
}); | ||
} | ||
return this.filter(function (event) { | ||
@@ -64,0 +74,0 @@ return (event.listen === name); |
@@ -158,3 +158,4 @@ var _ = require('../util').lodash, | ||
* @param {Boolean} options.enabled Only get the enabled headers | ||
* | ||
* @param {Boolean} options.multiValue When set to "true", duplicate header values will be stored in an array | ||
* @returns {Object} | ||
* @note If multiple headers are present in the same collection with same name, but different case | ||
@@ -166,3 +167,3 @@ * (E.g "x-forward-port" and "X-Forward-Port", and `options.ignoreCase` is set to true, the result will contain | ||
!options && (options = {}); | ||
return this.headers.toObject(options.enabled, !options.ignoreCase); | ||
return this.headers.toObject(options.enabled, !options.ignoreCase, options.multiValue); | ||
}, | ||
@@ -169,0 +170,0 @@ |
@@ -96,2 +96,3 @@ var _ = require('../util').lodash, | ||
obj, | ||
value, | ||
i, | ||
@@ -109,3 +110,6 @@ ii; | ||
if (obj.constructor._postman_propertyName === 'VariableList') { | ||
if (obj.has(key)) { return obj.one(key); } | ||
value = obj.one(key); | ||
if (value && !value.disabled) { | ||
return value; | ||
} | ||
} | ||
@@ -112,0 +116,0 @@ // else we return the value from the plain object |
@@ -5,3 +5,3 @@ { | ||
"author": "Postman Labs <help@getpostman.com>", | ||
"version": "3.4.1", | ||
"version": "3.4.2-beta.1", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "postman" |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
468890
74
10098
1