(stack: string | undefined)
| 57 | * Only called when an operation was actually slow — never on the fast path. |
| 58 | */ |
| 59 | export function callerFrame(stack: string | undefined): string { |
| 60 | if (!stack) return '' |
| 61 | for (const line of stack.split('\n')) { |
| 62 | if (line.includes('slowOperations')) continue |
| 63 | const m = line.match(/([^/\\]+?):(\d+):\d+\)?$/) |
| 64 | if (m) return ` @ ${m[1]}:${m[2]}` |
| 65 | } |
| 66 | return '' |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Builds a human-readable description from tagged template arguments. |