UNPKG

@hopeio/utils

Version:
23 lines (22 loc) 306 B
function o(r) { throw r().then( (t) => t ).catch((t) => { throw t; }), Error("执行失败"); } function c(r) { return new Promise((t, e) => { setTimeout(() => { try { t(1); } catch { e(0); } }, r); }); } export { o as doAsync, c as sleep };