Dashboard Temp Share Shortlinks Frames API

HTMLify

getFunctionName.js
Views: 6 | Author: cody
1
2
3
4
5
6
7
8
'use strict';

module.exports = function(fn) {
  if (fn.name) {
    return fn.name;
  }
  return (fn.toString().trim().match(/^function\s*([^\s(]+)/) || [])[1];
};