New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@trayio/threadneedle

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trayio/threadneedle - npm Package Compare versions

Comparing version 1.0.17 to 1.0.19

6

lib/addMethod/globalize/afterSuccess.js

@@ -8,3 +8,3 @@ /*

module.exports = function (config, body, params) {
module.exports = function (config, body, params, res) {
var threadneedle = this;

@@ -18,3 +18,3 @@ return when.promise(function (resolve, reject) {

if (_.isFunction(threadneedle._globalOptions.afterSuccess) && config.globals !== false) {
return when(threadneedle._globalOptions.afterSuccess(body, params));
return when(threadneedle._globalOptions.afterSuccess(body, params, res));
}

@@ -34,3 +34,3 @@ })

if (_.isFunction(config.afterSuccess)) {
return when(config.afterSuccess(body, params));
return when(config.afterSuccess(body, params, res));
}

@@ -37,0 +37,0 @@ })

@@ -34,11 +34,4 @@ var when = require('when');

if (_.isFunction(config)) {
logger.info(methodName+': Running method function.');
var fnPromise = config.call(threadneedle, params);
if (!_.isFunction(fnPromise.done)) {
throw new Error('Method `'+methodName+'` returns a function that isn\'t a valid promise.');
} else {
return fnPromise;
}
return when(config.call(threadneedle, params));
}

@@ -134,3 +127,6 @@

// If valid, then all good!
resolve(body);
resolve({
body: body,
response: res
});

@@ -155,5 +151,5 @@ }

// Handle the after success and failure messages
.done(function (body) {
.done(function (result) {
logger.info(methodName+': running `afterSuccess` hook');
globalize.afterSuccess.call(threadneedle, config, body, params).done(resolve, reject);
globalize.afterSuccess.call(threadneedle, config, result.body, params, result.response).done(resolve, reject);
}, function (err) {

@@ -160,0 +156,0 @@ logger.info(methodName+': running `afterFailure` hook', err);

{
"name": "@trayio/threadneedle",
"version": "1.0.17",
"version": "1.0.19",
"description": "A framework for simplifying working with HTTP-based APIs.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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