UNPKG

534 BJavaScriptView Raw
1"use strict";
2
3require("core-js/modules/es.function.name");
4
5Object.defineProperty(exports, "__esModule", {
6 value: true
7});
8exports.getType = getType;
9exports.getDisplayName = getDisplayName;
10
11var _reactIs = require("react-is");
12
13function getType(typeOrMemo) {
14 return (0, _reactIs.isMemo)(typeOrMemo) ? typeOrMemo.type : typeOrMemo;
15}
16
17function getDisplayName(typeOrMemo) {
18 if (typeof typeOrMemo === 'string') {
19 return typeOrMemo;
20 }
21
22 var type = getType(typeOrMemo);
23 return type.displayName || type.name || 'Unknown';
24}
\No newline at end of file