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

@creditkarma/async-scope

Package Overview
Dependencies
Maintainers
5
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@creditkarma/async-scope - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

dist/main/logger.d.ts

33

dist/main/AsyncScope.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const AsyncHooks = require("@creditkarma/async-hooks");
const logger = require("./logger");
const Utils = require("./utils");

@@ -21,10 +22,17 @@ const constants_1 = require("./constants");

init(asyncId, type, triggerAsyncId, resource) {
self._ensureNode(triggerAsyncId);
const parentNode = self.asyncMap[triggerAsyncId];
if (parentNode !== undefined) {
parentNode.children.push(asyncId);
parentNode.timestamp = Date.now();
self._addNode(asyncId, triggerAsyncId);
const savedMap = self.asyncMap;
try {
self._ensureNode(triggerAsyncId);
const parentNode = self.asyncMap[triggerAsyncId];
if (parentNode !== undefined) {
parentNode.children.push(asyncId);
parentNode.timestamp = Date.now();
self._addNode(asyncId, triggerAsyncId);
}
self._purge();
}
self._purge();
catch (err) {
logger.error(`An error occurred while creating scope: `, err);
self.asyncMap = savedMap;
}
},

@@ -34,4 +42,11 @@ before(asyncId) {

after(asyncId) {
Utils.destroyNode(asyncId, self.asyncMap);
self._purge();
const savedMap = self.asyncMap;
try {
Utils.destroyNode(asyncId, self.asyncMap);
self._purge();
}
catch (err) {
logger.error(`An error occurred while destroying scope with id[${asyncId}]: `, err);
self.asyncMap = savedMap;
}
},

@@ -38,0 +53,0 @@ promiseResolve(asyncId) {

{
"name": "@creditkarma/async-scope",
"version": "0.0.14",
"version": "0.0.15",
"description": "A thread local approximation built on async hooks, written in TypeScript",

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

Sorry, the diff of this file is not supported yet

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