Switch to BiomeJS (#306)

This commit is contained in:
Gregory Schier
2025-11-23 08:38:13 -08:00
committed by GitHub
parent 2bac610efe
commit ec3e2e16a9
332 changed files with 3007 additions and 4097 deletions

View File

@@ -3,16 +3,14 @@ import { sleep } from './sleep';
/** Ensures a promise takes at least a certain number of milliseconds to resolve */
export async function minPromiseMillis<T>(promise: Promise<T>, millis = 300) {
const start = Date.now();
let result;
let err;
let result: T;
try {
result = await promise;
} catch (e) {
err = e;
const delayFor = millis - (Date.now() - start);
await sleep(delayFor);
throw err;
throw e;
}
const delayFor = millis - (Date.now() - start);