UNPKG

4.5

Version:

Monadic test assertions

8 lines (5 loc) 147 B
export function functionName(f: any) { if (f.name) return f.name; const m = String(f).match(/^function\s*([\w$]+)/); if (m) return m[1]; }