UNPKG

@splitsoftware/splitio-commons

Version:
9 lines (7 loc) 195 B
/** * Returns the name of a given function. */ export function getFnName(fn: any): string { if (fn.name) return fn.name; return (fn.toString().match(/function (.+?)\(/) || ['', ''])[1]; }