Socket
Socket
Sign inDemoInstall

mappersmith

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mappersmith - npm Package Compare versions

Comparing version 2.32.0 to 2.32.1

2

mappersmith.js

@@ -16,3 +16,3 @@ "use strict";

/* global VERSION */
var version = "2.32.0";
var version = "2.32.1";
exports.version = version;

@@ -19,0 +19,0 @@ var configs = {

@@ -163,7 +163,11 @@ "use strict";

if (!hasParamMatchers) {
return finalRequest.url();
}
var urlMatcher = function urlMatcher(requestUrl, requestParams) {
var expandedParams = _this2.expandParams(params, requestParams);
var additionalParams = _this2.evaluateParamMatchers(params, requestParams);
var testRequest = finalRequest.enhance({
params: expandedParams
params: additionalParams
});

@@ -173,3 +177,3 @@ return testRequest.url() === requestUrl;

return hasParamMatchers ? urlMatcher : finalRequest.url();
return urlMatcher;
},

@@ -199,10 +203,17 @@

*/
expandParams: function expandParams(mockParams, requestParams) {
evaluateParamMatchers: function evaluateParamMatchers(mockParams, requestParams) {
return Object.keys(mockParams).reduce(function (obj, key) {
var value = requestParams[key];
var matcher = mockParams[key];
if (typeof mockParams[key] === 'function') {
obj[key] = mockParams[key](value) ? value : VALUE_NOT_MATCHED;
if (typeof matcher !== 'function') {
return obj;
}
var value = requestParams[key]; // Only evaluate if key was provided in request params.
// Otherwise we always consider it not to match.
if (key in requestParams && matcher(value)) {
obj[key] = value;
} else {
obj[key] = value;
obj[key] = VALUE_NOT_MATCHED;
}

@@ -209,0 +220,0 @@

{
"name": "mappersmith",
"version": "2.32.0",
"version": "2.32.1",
"description": "It is a lightweight rest client for node.js and the browser",

@@ -5,0 +5,0 @@ "author": "Tulio Ornelas <ornelas.tulio@gmail.com>",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc