worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
44
node_modules/@mui/utils/getDisplayName/getDisplayName.js
generated
vendored
Normal file
44
node_modules/@mui/utils/getDisplayName/getDisplayName.js
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getDisplayName;
|
||||
var _reactIs = require("react-is");
|
||||
function getFunctionComponentName(Component, fallback = '') {
|
||||
return Component.displayName || Component.name || fallback;
|
||||
}
|
||||
function getWrappedName(outerType, innerType, wrapperName) {
|
||||
const functionName = getFunctionComponentName(innerType);
|
||||
return outerType.displayName || (functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName);
|
||||
}
|
||||
|
||||
/**
|
||||
* cherry-pick from
|
||||
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
||||
* originally forked from recompose/getDisplayName
|
||||
*/
|
||||
function getDisplayName(Component) {
|
||||
if (Component == null) {
|
||||
return undefined;
|
||||
}
|
||||
if (typeof Component === 'string') {
|
||||
return Component;
|
||||
}
|
||||
if (typeof Component === 'function') {
|
||||
return getFunctionComponentName(Component, 'Component');
|
||||
}
|
||||
|
||||
// TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense`
|
||||
if (typeof Component === 'object') {
|
||||
switch (Component.$$typeof) {
|
||||
case _reactIs.ForwardRef:
|
||||
return getWrappedName(Component, Component.render, 'ForwardRef');
|
||||
case _reactIs.Memo:
|
||||
return getWrappedName(Component, Component.type, 'memo');
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue