@opentelemetry/instrumentation
Advanced tools
Comparing version
@@ -11,3 +11,2 @@ import * as types from '../../types'; | ||
constructor(instrumentationName: string, instrumentationVersion: string, config?: types.InstrumentationConfig); | ||
private _isSupported; | ||
private _onRequire; | ||
@@ -14,0 +13,0 @@ enable(): void; |
@@ -45,15 +45,2 @@ "use strict"; | ||
} | ||
_isSupported(name, version) { | ||
for (const module of this._modules) { | ||
if (module.name === name) { | ||
if (!module.supportedVersions) { | ||
return true; | ||
} | ||
return module.supportedVersions.some(supportedVersion => { | ||
return semver.satisfies(version, supportedVersion); | ||
}); | ||
} | ||
} | ||
return false; | ||
} | ||
_onRequire(module, exports, name, baseDir) { | ||
@@ -72,3 +59,4 @@ var _a; | ||
// main module | ||
if (typeof version === 'string' && this._isSupported(name, version)) { | ||
if (typeof version === 'string' && | ||
isSupported(module.supportedVersions, version)) { | ||
if (typeof module.patch === 'function') { | ||
@@ -86,4 +74,3 @@ module.moduleExports = exports; | ||
const file = files.find(file => file.name === name); | ||
if (file && | ||
file.supportedVersions.some(supportedVersion => semver.satisfies(version, supportedVersion))) { | ||
if (file && isSupported(file.supportedVersions, version)) { | ||
file.moduleExports = exports; | ||
@@ -140,2 +127,7 @@ if (this._enabled) { | ||
exports.InstrumentationBase = InstrumentationBase; | ||
function isSupported(supportedVersions, version) { | ||
return supportedVersions.some(supportedVersion => { | ||
return semver.satisfies(version, supportedVersion); | ||
}); | ||
} | ||
//# sourceMappingURL=instrumentation.js.map |
{ | ||
"name": "@opentelemetry/instrumentation", | ||
"version": "0.18.3-alpha.25+4ef22cae", | ||
"version": "0.18.3-alpha.33+c516264e", | ||
"description": "Base class for node which OpenTelemetry instrumentation modules extend", | ||
@@ -57,3 +57,3 @@ "author": "OpenTelemetry Authors", | ||
"dependencies": { | ||
"@opentelemetry/api-metrics": "^0.18.3-alpha.25+4ef22cae", | ||
"@opentelemetry/api-metrics": "^0.18.2", | ||
"require-in-the-middle": "^5.0.3", | ||
@@ -98,3 +98,3 @@ "semver": "^7.3.2", | ||
}, | ||
"gitHead": "4ef22cae74b9c976f969151ebcc3ae3d931cf9c6" | ||
"gitHead": "c516264ed0c01b714770c5d2a8ca78fd793625d9" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
70116
-0.83%884
-1.01%+ Added
+ Added
- Removed