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

@poppinss/hooks

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@poppinss/hooks - npm Package Compare versions

Comparing version 6.0.1-0 to 6.0.2-0

9

build/src/Runner/index.js

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

this.withoutHooks = withoutHooks;
this.cleanupActions = new Set();
this.cleanupActions = [];
/**

@@ -41,3 +41,3 @@ * Find if cleanup call is pending or not. The cleanup is only

const cleanupAction = await handler(...data);
typeof cleanupAction === 'function' && this.cleanupActions.add(cleanupAction);
typeof cleanupAction === 'function' && this.cleanupActions.push(cleanupAction);
}

@@ -51,4 +51,5 @@ }

this.isCleanupPending = false;
for (let action of this.cleanupActions) {
await action(...data);
let startIndex = this.cleanupActions.length;
while (startIndex--) {
await this.cleanupActions[startIndex](...data);
}

@@ -55,0 +56,0 @@ }

{
"name": "@poppinss/hooks",
"version": "6.0.1-0",
"version": "6.0.2-0",
"description": "A no brainer hooks module for execute before/after lifecycle hooks",

@@ -32,3 +32,3 @@ "main": "build/index.js",

"@adonisjs/require-ts": "^2.0.9",
"@types/node": "^17.0.15",
"@types/node": "^17.0.18",
"commitizen": "^4.2.4",

@@ -38,4 +38,4 @@ "cz-conventional-changelog": "^3.3.0",

"doctoc": "^2.0.1",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.9.0",
"eslint-config-prettier": "^8.4.0",
"eslint-plugin-adonis": "^2.1.0",

@@ -42,0 +42,0 @@ "eslint-plugin-prettier": "^4.0.0",

@@ -118,2 +118,4 @@ <div align="center"><img src="https://res.cloudinary.com/adonisjs/image/upload/q_100/v1557762307/poppinss_iftxlt.jpg" width="600px"></div>

Also, the cleanup hooks runs in the reverse order. So the cleanup function for the first hook will run last.
## Passing data to hooks

@@ -120,0 +122,0 @@ You can pass data to hooks at the time of running the `run` and the `cleanup` functions. For example.

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