UNPKG

@olton/latte

Version:

Simple test framework for JavaScript and TypeScript with DOM supports

9 lines (8 loc) 218 B
export function parentFunc () { try { throw new Error() } catch (e) { const stack = e.stack.match(/(\w+)@|at (\w+) \(/g).map(f => f.replace(/@|at |[(\s]|\)/g, '')) return stack[2] ?? null } }