( path: string, content: string, )
| 96 | } |
| 97 | |
| 98 | async function applyDebugLogBudgetAsync( |
| 99 | path: string, |
| 100 | content: string, |
| 101 | ): Promise<string | null> { |
| 102 | const state = getDebugLogBudgetState(path) |
| 103 | let existingBytes = state.bytes |
| 104 | if (!state.initialized) { |
| 105 | try { |
| 106 | existingBytes = (await stat(path)).size |
| 107 | } catch { |
| 108 | existingBytes = 0 |
| 109 | } |
| 110 | } |
| 111 | return applyDebugLogBudget(path, content, existingBytes) |
| 112 | } |
| 113 | |
| 114 | function applyDebugLogBudgetSync(path: string, content: string): string | null { |
| 115 | const state = getDebugLogBudgetState(path) |
no test coverage detected