UNPKG

538 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3/**
4 * `setTimeoutUnref` is just like `setTimeout`,
5 * only in Node's environment it will "unref" its macro task.
6 */
7function setTimeoutUnref(callback, time, args) {
8 const ref = setTimeout.apply(typeof globalThis !== 'undefined' ? globalThis : global, arguments);
9 if (ref && typeof ref === 'object' && typeof ref.unref === 'function')
10 ref.unref();
11 return ref;
12}
13exports.default = setTimeoutUnref;
14//# sourceMappingURL=setTimeoutUnref.js.map
\No newline at end of file