MCPcopy Create free account
hub / github.com/Noumena-Network/code / waitForFile

Function waitForFile

src/ink/tmuxResetSequence.test.ts:178–187  ·  view source on GitHub ↗
(path: string, timeoutMs = 2000)

Source from the content-addressed store, hash-verified

176}
177
178async function waitForFile(path: string, timeoutMs = 2000): Promise<void> {
179 const deadline = Date.now() + timeoutMs
180 while (Date.now() < deadline) {
181 if (existsSync(path)) {
182 return
183 }
184 await Bun.sleep(10)
185 }
186 throw new Error(`Timed out waiting for ${path}`)
187}
188
189function splitAfterFirstRenderedRow(serializedDiff: string): [string, string] {
190 const rowBreak = serializedDiff.indexOf('\r\n')

Calls 2

existsSyncFunction · 0.90
sleepMethod · 0.80

Tested by

no test coverage detected