(budget: SerializedByteBudget, bytes: number)
| 133 | } |
| 134 | |
| 135 | function addSerializedBytes(budget: SerializedByteBudget, bytes: number): boolean { |
| 136 | if (budget.bytes > Number.MAX_SAFE_INTEGER - bytes) { |
| 137 | budget.bytes = Number.POSITIVE_INFINITY; |
| 138 | return false; |
| 139 | } |
| 140 | if (budget.bytes + bytes > budget.limit) { |
| 141 | budget.bytes = |
| 142 | budget.limit < Number.MAX_SAFE_INTEGER ? budget.limit + 1 : Number.POSITIVE_INFINITY; |
| 143 | return false; |
| 144 | } |
| 145 | budget.bytes += bytes; |
| 146 | return true; |
| 147 | } |
| 148 | |
| 149 | export interface CodeModeLimits { |
| 150 | maxSourceBytes: number; |
no outgoing calls
no test coverage detected