const BASE = 'malice';
const PREFIX = `${BASE} trace=`;

export function workerName(filter: string | null): string {
  const trimmed = filter?.trim();
  return trimmed ? PREFIX + trimmed : BASE;
}

export function traceFilter(name: string): string {
  return name.startsWith(PREFIX) ? name.slice(PREFIX.length) : '';
}

