Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mappersmith

Package Overview
Dependencies
Maintainers
3
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.6.1 to 2.7.0

7

client-builder.js

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

*/
function ClientBuilder(manifest, GatewayClassFactory) {
function ClientBuilder(manifest, GatewayClassFactory, defaultGatewayConfigs) {
if (!manifest) {

@@ -36,3 +36,3 @@ throw new Error('[Mappersmith] invalid manifest (' + manifest + ')');

this.manifest = new _manifest2.default(manifest);
this.manifest = new _manifest2.default(manifest, defaultGatewayConfigs);
this.GatewayClassFactory = GatewayClassFactory;

@@ -70,4 +70,5 @@ }

var GatewayClass = this.GatewayClassFactory();
var gatewayConfigs = this.manifest.gatewayConfigs;
var callGateway = function callGateway() {
return new GatewayClass(finalRequest).call();
return new GatewayClass(finalRequest, gatewayConfigs).call();
};

@@ -74,0 +75,0 @@

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

function Gateway(request) {
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
this.request = request;
this.configs = configs;
this.successCallback = function () {};

@@ -30,3 +33,3 @@ this.failCallback = function () {};

options: function options() {
return _mappersmith.configs.gatewayConfigs;
return this.configs;
},

@@ -33,0 +36,0 @@ shouldEmulateHTTP: function shouldEmulateHTTP() {

@@ -19,7 +19,11 @@ 'use strict';

* @param {String} obj.host
* @param {String} obj.resources - default: {}
* @param {String} obj.middlewares - default: []
* @param {Object} obj.gatewayConfigs - default: base values from mappersmith
* @param {Object} obj.resources - default: {}
* @param {Array} obj.middlewares - default: []
*/
function Manifest(obj) {
var defaultGatewayConfigs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
this.host = obj.host;
this.gatewayConfigs = (0, _utils.assign)({}, defaultGatewayConfigs, obj.gatewayConfigs);
this.resources = obj.resources || {};

@@ -26,0 +30,0 @@ this.middlewares = obj.middlewares || [];

@@ -85,5 +85,6 @@ 'use strict';

};function forge(manifest) {
return new _clientBuilder2.default(manifest, function () {
var GatewayClassFactory = function GatewayClassFactory() {
return configs.gateway;
}).build();
};
return new _clientBuilder2.default(manifest, GatewayClassFactory, configs.gatewayConfigs).build();
}
{
"name": "mappersmith",
"version": "2.6.1",
"version": "2.7.0",
"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