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

@opentelemetry/context-async-hooks

Package Overview
Dependencies
Maintainers
4
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/context-async-hooks - npm Package Compare versions

Comparing version 0.10.3-canary.0 to 0.11.0

26

build/src/AbstractAsyncHooksContextManager.js

@@ -20,2 +20,3 @@ "use strict";

const events_1 = require("events");
const kOtListeners = Symbol('OtListeners');
const ADD_LISTENER_METHODS = [

@@ -65,5 +66,5 @@ 'addListener',

const ee = target;
if (ee.__ot_listeners !== undefined)
if (ee[kOtListeners] !== undefined)
return target;
ee.__ot_listeners = {};
ee[kOtListeners] = {};
// patch methods that add a listener to propagate context

@@ -96,7 +97,7 @@ ADD_LISTENER_METHODS.forEach(methodName => {

return function (event, listener) {
if (ee.__ot_listeners === undefined ||
ee.__ot_listeners[event] === undefined) {
var _a;
const events = (_a = ee[kOtListeners]) === null || _a === void 0 ? void 0 : _a[event];
if (events === undefined) {
return original.call(this, event, listener);
}
const events = ee.__ot_listeners[event];
const patchedListener = events.get(listener);

@@ -114,7 +115,6 @@ return original.call(this, event, patchedListener || listener);

return function (event) {
if (ee.__ot_listeners === undefined ||
ee.__ot_listeners[event] === undefined) {
return original.call(this, event);
var _a;
if (((_a = ee[kOtListeners]) === null || _a === void 0 ? void 0 : _a[event]) !== undefined) {
delete ee[kOtListeners][event];
}
delete ee.__ot_listeners[event];
return original.call(this, event);

@@ -133,8 +133,8 @@ };

return function (event, listener) {
if (ee.__ot_listeners === undefined)
ee.__ot_listeners = {};
let listeners = ee.__ot_listeners[event];
if (ee[kOtListeners] === undefined)
ee[kOtListeners] = {};
let listeners = ee[kOtListeners][event];
if (listeners === undefined) {
listeners = new WeakMap();
ee.__ot_listeners[event] = listeners;
ee[kOtListeners][event] = listeners;
}

@@ -141,0 +141,0 @@ const patchedListener = contextManager.bind(listener, context);

@@ -1,2 +0,2 @@

export declare const VERSION = "0.10.3-canary.0+f4f2f84";
export declare const VERSION = "0.11.0";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.10.3-canary.0+f4f2f84';
exports.VERSION = '0.11.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/context-async-hooks",
"version": "0.10.3-canary.0+f4f2f84",
"version": "0.11.0",
"description": "OpenTelemetry AsyncHooks-based Context Manager",

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

"devDependencies": {
"@types/mocha": "8.0.0",
"@types/mocha": "8.0.2",
"@types/node": "14.0.27",

@@ -59,5 +59,5 @@ "@types/shimmer": "1.0.1",

"dependencies": {
"@opentelemetry/context-base": "^0.10.3-canary.0+f4f2f84"
"@opentelemetry/context-base": "^0.11.0"
},
"gitHead": "f4f2f84bc087389b3206a2e17837b7b0b95fb2f2"
"gitHead": "15174c6647ab9863dfc1424412fa60f2fddb3351"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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