Socket
Socket
Sign inDemoInstall

@opentelemetry/context-base

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/context-base - npm Package Compare versions

Comparing version 0.16.0 to 0.16.1-alpha.11

3

build/src/index.js

@@ -25,5 +25,6 @@ "use strict";

var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ROOT_CONTEXT = exports.createContextKey = void 0;
var context_1 = require("./context");

@@ -30,0 +31,0 @@ Object.defineProperty(exports, "createContextKey", { enumerable: true, get: function () { return context_1.createContextKey; } });

import * as types from './types';
export declare class NoopContextManager implements types.ContextManager {
active(): types.Context;
with<T extends (...args: unknown[]) => ReturnType<T>>(_context: types.Context, fn: T): ReturnType<T>;
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(_context: types.Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
bind<T>(target: T, _context?: types.Context): T;

@@ -6,0 +6,0 @@ enable(): this;

@@ -17,2 +17,9 @@ "use strict";

*/
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -27,4 +34,8 @@ exports.NoopContextManager = void 0;

};
NoopContextManager.prototype.with = function (_context, fn) {
return fn();
NoopContextManager.prototype.with = function (_context, fn, thisArg) {
var args = [];
for (var _i = 3; _i < arguments.length; _i++) {
args[_i - 3] = arguments[_i];
}
return fn.call.apply(fn, __spreadArrays([thisArg], args));
};

@@ -31,0 +42,0 @@ NoopContextManager.prototype.bind = function (target, _context) {

@@ -33,4 +33,6 @@ export interface Context {

* @param fn A callback to be immediately run within a specific context
* @param thisArg optional receiver to be used for calling fn
* @param args optional arguments forwarded to fn
*/
with<T extends (...args: unknown[]) => ReturnType<T>>(context: Context, fn: T): ReturnType<T>;
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
/**

@@ -37,0 +39,0 @@ * Bind an object as the current context (or a specific one)

{
"name": "@opentelemetry/context-base",
"version": "0.16.0",
"version": "0.16.1-alpha.11+70a128ff",
"description": "OpenTelemetry Base Context Manager",

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

"codecov": "3.8.1",
"gts": "2.0.2",
"gts": "3.1.0",
"mocha": "7.2.0",

@@ -55,5 +55,5 @@ "nyc": "15.1.0",

"ts-node": "9.1.1",
"typescript": "3.9.7"
"typescript": "4.1.3"
},
"gitHead": "e68863f8e63854b08ad13fb54677294ac6d6b681"
"gitHead": "70a128ff5dca16060ca7c2cff943369ae9999c34"
}

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