@opentelemetry/api
Version:
Public API for OpenTelemetry
1 lines • 1.34 kB
Source Map (JSON)
{"version":3,"file":"NoopContextManager.mjs","names":[],"sources":["../../src/context/NoopContextManager.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ROOT_CONTEXT } from './context';\nimport type * as types from './types';\n\nexport class NoopContextManager implements types.ContextManager {\n active(): types.Context {\n return ROOT_CONTEXT;\n }\n\n with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(\n _context: types.Context,\n fn: F,\n thisArg?: ThisParameterType<F>,\n ...args: A\n ): ReturnType<F> {\n return fn.call(thisArg, ...args);\n }\n\n bind<T>(_context: types.Context, target: T): T {\n return target;\n }\n\n enable(): this {\n return this;\n }\n\n disable(): this {\n return this;\n }\n\n /** @experimental This API is experimental and may change in minor releases without prior notice. */\n attach(_context: types.Context): types.ContextManagementToken {\n return { dispose() {} };\n }\n}\n"],"mappings":";;AAQA,IAAa,qBAAb,MAAgE;CAC9D,SAAwB;EACtB,OAAO;CACT;CAEA,KACE,UACA,IACA,SACA,GAAG,MACY;EACf,OAAO,GAAG,KAAK,SAAS,GAAG,IAAI;CACjC;CAEA,KAAQ,UAAyB,QAAc;EAC7C,OAAO;CACT;CAEA,SAAe;EACb,OAAO;CACT;CAEA,UAAgB;EACd,OAAO;CACT;;CAGA,OAAO,UAAuD;EAC5D,OAAO,EAAE,UAAU,CAAC,EAAE;CACxB;AACF"}