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

@fangxq/async-context

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fangxq/async-context - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

14

index.js

@@ -21,3 +21,3 @@ const AsyncLocalStorage = require('async_hooks').AsyncLocalStorage

if (publicConstructor[path]) {
if (!publicContext[path]) publicContext[path] = new publicConstructor[path]()
if (!publicContext[path]) publicContext[path] = createModule(publicConstructor[path])

@@ -29,3 +29,3 @@ return publicContext[path]

if (!privateContext[token]) privateContext[token] = {}
if (!privateContext[token][path]) privateContext[token][path] = new privateConstructor[path]()
if (!privateContext[token][path]) privateContext[token][path] = createModule(privateConstructor[path])

@@ -36,2 +36,12 @@ return privateContext[token][path]

function createModule(ctr) {
const obj = new ctr()
Object.keys(ctr.prototype).forEach(k => {
obj[k] = ctr.prototype[k].bind(obj)
})
return obj
}
module.exports.asyncContext = {

@@ -38,0 +48,0 @@ definePrivate(path, ctr) {

2

package.json
{
"name": "@fangxq/async-context",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "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