UNPKG

@jable/inject

Version:

Inject dependencies into injectable classes

11 lines (10 loc) 414 B
"use strict"; 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;