Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
value = _msec as T | PromiseLike;
msec = cancelable;
cancelable = Cancelable.none;
}
else {
msec = _msec as number;
}
Cancelable.throwIfSignaled(cancelable);
const handle = setTimeout(() => {
subscription.unsubscribe();
resolve(value);
}, msec);
const subscription = Cancelable.subscribe(cancelable, () => {
clearTimeout(handle);
reject(new CancelError());
});
});
}