You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
493 B

3 months ago
  1. "use strict";
  2. Object.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. */
  7. function setTimeoutUnref(callback, time, args) {
  8. var 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. }
  13. exports.default = setTimeoutUnref;