UNPKG

@blynx/inject

Version:
10 lines (9 loc) 390 B
Object.defineProperty(exports, "__esModule", { value: true }); var constants_1 = require("./constants"); function getName(target) { if (typeof target === 'object') { return target.toString().match(/^\[object\s([^\s\]]+)\]/)[1]; } return target[constants_1.NameProperty] || target.name || target.toString().match(/^function\s*([^\s(]+)/)[1]; } exports.getName = getName;