dc-polyfill
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -59,1 +59,10 @@ const [ MAJOR, MINOR, PATCH ] = process.versions.node.split('.').map(Number); | ||
module.exports.hasSyncUnsubscribeBug = hasSyncUnsubscribeBug; | ||
// if there is a TracingChannel#hasSubscribers() getter | ||
// @see https://github.com/nodejs/node/pull/51915 | ||
// TODO: note that we still need to add the TC early exit from this same version | ||
function hasTracingChannelHasSubscribers() { | ||
return MAJOR >= 22 | ||
|| (MAJOR == 20 && MINOR >= 13); | ||
}; | ||
module.exports.hasTracingChannelHasSubscribers = hasTracingChannelHasSubscribers; |
@@ -33,3 +33,7 @@ const checks = require('./checks.js'); | ||
if (!checks.hasTracingChannelHasSubscribers()) { | ||
dc = require('./patch-tracing-channel-has-subscribers.js')(dc); | ||
} | ||
module.exports = dc; | ||
{ | ||
"name": "dc-polyfill", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "A polyfill for the internal diagnostics_channel module", | ||
@@ -5,0 +5,0 @@ "main": "dc-polyfill.js", |
@@ -16,2 +16,4 @@ # `dc-polyfill`: Diagnostics Channel Polyfill | ||
> Note that `dc-polyfill` currently has the `TracingChannel#hasSubscribers` getter backported from Node.js v22 however it doesn't yet support the tracing channel early exit feature. Once that's been added we'll delete this clause and update the above table. | ||
Whenever the currently running version of Node.js ships with `diagnostics_channel` (i.e. v16+, v15.14+, v14.17+), **dc-polyfill** will make sure to use the global registry of channels provided by the core module. For older versions of Node.js **dc-polyfill** instead uses its own global collection of channels. This global collection remains in the same location and is shared across all instances of **dc-polyfill**. This avoids the issue wherein multiple versions of an npm library installed in a module dependency hierarchy would otherwise provide different singleton instances. | ||
@@ -18,0 +20,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36948
19
620
48