Socket
Socket
Sign inDemoInstall

mappersmith

Package Overview
Dependencies
Maintainers
1
Versions
121
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.24.0 to 2.24.1

2

mappersmith.js

@@ -18,3 +18,3 @@ 'use strict';

/* global VERSION */
var version = exports.version = '2.24.0';
var version = exports.version = '2.24.1';

@@ -21,0 +21,0 @@ var configs = exports.configs = {

@@ -38,14 +38,7 @@ 'use strict';

this.body = this.bodyFunction ? props.body : (0, _utils.toQueryString)(props.body);
this.responseData = props.response.body;
this.responseHeaders = props.response.headers || {};
this.setResponseData(props.response.body);
this.responseStatus = props.response.status || 200;
this.calls = [];
if ((0, _utils.isPlainObject)(this.responseData)) {
this.responseData = JSON.stringify(this.responseData);
if (!this.responseHeaders['content-type']) {
this.responseHeaders['content-type'] = 'application/json';
}
}
}

@@ -55,2 +48,19 @@

/**
* If passed a plain object, the data is stringified and the content-type header is set to JSON
*
* @public
*/
setResponseData: function setResponseData(responseData) {
if ((0, _utils.isPlainObject)(responseData)) {
this.responseData = JSON.stringify(responseData);
if (!this.responseHeaders['content-type']) {
this.responseHeaders['content-type'] = 'application/json';
}
} else {
this.responseData = responseData;
}
},
/**
* @return {Response}

@@ -57,0 +67,0 @@ */

@@ -155,3 +155,3 @@ 'use strict';

this.mockRequest.responseStatus = responseStatus;
this.mockRequest.responseData = responseData;
this.mockRequest.setResponseData(responseData);

@@ -158,0 +158,0 @@ return this.mockRequest;

{
"name": "mappersmith",
"version": "2.24.0",
"version": "2.24.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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc