| 1 | const BASE = 'malice'; |
| 2 | const PREFIX = `${BASE} trace=`; |
| 3 | |
| 4 | export function workerName(filter: string | null): string { |
| 5 | const trimmed = filter?.trim(); |
| 6 | return trimmed ? PREFIX + trimmed : BASE; |
| 7 | } |
| 8 | |
| 9 | export function traceFilter(name: string): string { |
| 10 | return name.startsWith(PREFIX) ? name.slice(PREFIX.length) : ''; |
| 11 | } |
| 12 |