Type the settled bridge stat as fs.Stats so tsc does not see bigint.

Awaited<ReturnType<typeof fsp.stat>> collapsed the bigint overload and broke prepare/typecheck on CI.
This commit is contained in:
Gergo Magyar 2026-09-12 19:30:13 +00:00
parent c3744a9a79
commit b8450dfa84

View file

@ -1,3 +1,4 @@
import type { Stats } from 'node:fs';
import fsp from 'node:fs/promises';
import path from 'node:path';
import { createHash } from 'node:crypto';
@ -724,9 +725,7 @@ const stampMatchesStat = (
* the atomic rename. Stamping the first `stat` then loses the exact-equality
* check the moment that flush lands. Wait until two consecutive stats agree.
*/
const statSettledBridgeFile = async (
filePath: string,
): Promise<Awaited<ReturnType<typeof fsp.stat>>> => {
const statSettledBridgeFile = async (filePath: string): Promise<Stats> => {
let current = await fsp.stat(filePath);
for (let i = 0; i < 10; i++) {
await new Promise((resolve) => setImmediate(resolve));