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

@captain-hook/core

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@captain-hook/core - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

14

lib/utils/chain.js

@@ -9,8 +9,14 @@ "use strict";

const chain = (payload, ...plugins) => {
let current = { ...payload
};
for (const plugin of plugins) {
// eslint-disable-next-line no-continue
if (!plugin?.test?.(payload)) continue;
const shouldContinue = plugin.receive(payload);
if (!plugin?.test?.(current)) {
// eslint-disable-next-line no-continue
continue;
}
if (!shouldContinue) {
current = plugin.receive(current);
if (!current) {
break;

@@ -17,0 +23,0 @@ }

{
"name": "@captain-hook/core",
"version": "0.1.0",
"version": "0.1.1",
"description": "web(hook hand)lers",

@@ -12,3 +12,4 @@ "author": "Luke Smetham",

"jsonwebtoken": "^8.5.1"
}
},
"gitHead": "089afb824971564bf8e0a77f9c69b388512211c4"
}
export const chain = (payload, ...plugins) => {
for (const plugin of plugins) {
// eslint-disable-next-line no-continue
if (!plugin?.test?.(payload)) continue;
let current = {...payload};
const shouldContinue = plugin.receive(payload);
for (const plugin of plugins) {
if (!plugin?.test?.(current)) {
// eslint-disable-next-line no-continue
continue;
}
if (!shouldContinue) {
break;
}
}
current = plugin.receive(current);
if (!current) {
break;
}
}
};
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