UNPKG

@zenkit/styles

Version:

ZenKit components for impliments styles

22 lines (18 loc) 607 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/; function getFunctionName(fn) { var match = "".concat(fn).match(fnNameMatchRegex); var name = match && match[1]; return name || ''; } function getDisplayName(Component) { if (!Component) return undefined; if (typeof Component === 'string') return Component; return Component.displayName || Component.name || getFunctionName(Component) || 'Component'; } var _default = getDisplayName; exports.default = _default;