UNPKG

@pmwcs/base

Version:
7 lines (6 loc) 863 B
export const getDisplayName = childInput => { var _child$type, _child$constructor, _child$constructor2; const child = Array.isArray(childInput) ? childInput[0] : childInput; const displayName = (child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) || (child === null || child === void 0 ? void 0 : (_child$constructor = child.constructor) === null || _child$constructor === void 0 ? void 0 : _child$constructor.displayName) || (child === null || child === void 0 ? void 0 : child.displayName) || (child === null || child === void 0 ? void 0 : child.name) || (child === null || child === void 0 ? void 0 : (_child$constructor2 = child.constructor) === null || _child$constructor2 === void 0 ? void 0 : _child$constructor2.name) || 'Unknown'; return displayName; };