site-panzai/node_modules/readable-stream/lib/internal/shims/process.js

20 lines
553 B
JavaScript
Raw Permalink Normal View History

2026-11-13 13:57:04 +01:00
'use strict'
/* wraps the internal process module, circumventing issues with some polyfills (see #539) */
const process = ((base, esmKey, keys, isValid) => {
if (esmKey in base && base[esmKey] === true) {
let candidate
for (const key of keys) {
if (!(key in base)) {
continue
}
candidate = base[key]
if (isValid(candidate)) {
return candidate
}
}
}
return base
})(require('process/'), '__esModule', ['default', 'process'], (candidate) => 'nextTick' in candidate)
module.exports = process