postman-collection
Advanced tools
Comparing version 4.1.2 to 4.1.3
@@ -16,2 +16,3 @@ var _ = require('../util').lodash, | ||
PATH_SEPARATOR = '/', | ||
PATH_VARIABLE_SEPARATOR = '.', | ||
PATH_VARIABLE_IDENTIFIER = ':', | ||
@@ -35,2 +36,20 @@ PORT_SEPARATOR = ':', | ||
/** | ||
* Returns path variable name from the path segment. | ||
* | ||
* @private | ||
* @param {String} pathSegment - | ||
* @returns {String|null} | ||
*/ | ||
parsePathVariable = function (pathSegment) { | ||
if (String(pathSegment).startsWith(PATH_VARIABLE_IDENTIFIER)) { | ||
const separatorIndex = pathSegment.indexOf(PATH_VARIABLE_SEPARATOR); | ||
// remove path variable prefix and everything followed by the separator | ||
return pathSegment.slice(1, separatorIndex === -1 ? undefined : separatorIndex) || null; | ||
} | ||
return null; | ||
}, | ||
Url; | ||
@@ -278,11 +297,11 @@ | ||
segments = _.transform(this.path, function (res, segment) { | ||
var variable; | ||
const variableKey = parsePathVariable(segment), | ||
variableValue = self.variables.get(variableKey); | ||
// check if the segment has path variable prefix followed by the variable name. | ||
if (_.startsWith(segment, PATH_VARIABLE_IDENTIFIER) && segment !== PATH_VARIABLE_IDENTIFIER) { | ||
variable = self.variables.one(segment.slice(1)); // remove path variable prefix. | ||
if (variableValue && typeof variableValue === STRING) { | ||
// replace the variable with its value while preserving the suffix | ||
segment = variableValue + segment.slice(variableKey.length + 1); | ||
} | ||
variable = variable && variable.valueOf && variable.valueOf(); | ||
res.push(_.isString(variable) ? variable : segment); | ||
res.push(segment); | ||
}, []); | ||
@@ -419,9 +438,5 @@ | ||
pathVariables = _.transform(url.path, function (res, segment) { | ||
// check if the segment has path variable prefix followed by the variable name and | ||
// the variable is not already added in the list. | ||
if (_.startsWith(segment, PATH_VARIABLE_IDENTIFIER) && | ||
segment !== PATH_VARIABLE_IDENTIFIER && | ||
!pathVariableKeys[segment]) { | ||
if ((segment = parsePathVariable(segment)) && !pathVariableKeys[segment]) { | ||
pathVariableKeys[segment] = true; | ||
res.push({ key: segment.slice(1) }); // remove path variable prefix. | ||
res.push({ key: segment }); | ||
} | ||
@@ -428,0 +443,0 @@ }, []); |
@@ -158,3 +158,3 @@ var util = require('../util'), | ||
*/ | ||
// eslint-disable-next-line max-len | ||
// eslint-disable-next-line max-len, security/detect-unsafe-regex | ||
encodedFileNameRegex: /;[ \t]*(?:filename\*)[ \t]*=[ \t]*([A-Za-z0-9!#$%&+\-^_`{}~]+)'.*'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)[ \t]*/, | ||
@@ -161,0 +161,0 @@ |
{ | ||
"name": "postman-collection", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"description": "Enables developers to use a unified Postman Collection format Object across projects", | ||
@@ -35,3 +35,3 @@ "author": "Postman Inc.", | ||
"dependencies": { | ||
"@faker-js/faker": "6.0.0", | ||
"@faker-js/faker": "6.3.1", | ||
"file-type": "3.9.0", | ||
@@ -45,3 +45,3 @@ "http-reasons": "0.1.0", | ||
"postman-url-encoder": "3.0.5", | ||
"semver": "7.3.5", | ||
"semver": "7.3.7", | ||
"uuid": "8.3.2" | ||
@@ -61,7 +61,7 @@ }, | ||
"eslint-plugin-lodash": "^7.4.0", | ||
"eslint-plugin-mocha": "^10.0.3", | ||
"eslint-plugin-security": "^1.4.0", | ||
"eslint-plugin-mocha": "^10.0.4", | ||
"eslint-plugin-security": "^1.5.0", | ||
"js-yaml": "^4.1.0", | ||
"jsdoc": "^3.6.10", | ||
"karma": "^6.3.17", | ||
"karma": "^6.3.20", | ||
"karma-browserify": "^8.1.0", | ||
@@ -68,0 +68,0 @@ "karma-chrome-launcher": "^3.1.1", |
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
504633
11285
+ Added@faker-js/faker@6.3.1(transitive)
+ Addedsemver@7.3.7(transitive)
- Removed@faker-js/faker@6.0.0(transitive)
- Removedsemver@7.3.5(transitive)
Updated@faker-js/faker@6.3.1
Updatedsemver@7.3.7