UNPKG

@tempots/std

Version:

Std library for TypeScript. Natural complement to the Tempo libraries.

2 lines (1 loc) 272 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=(t,{abortSignal:e}={})=>new Promise((o,r)=>{const i=setTimeout(o,t);e&&e.addEventListener("abort",()=>{clearTimeout(i),r(new DOMException("Aborted","AbortError"))})});exports.sleep=s;