Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
32 lines
754 B
JavaScript
32 lines
754 B
JavaScript
// Module ID: 7009
|
|
// Function ID: 7010
|
|
// Dependencies: [19]
|
|
// Exports: getValidComponent, isComponentClass
|
|
|
|
// Module 7009
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
|
|
export const isComponentClass = (fn) => {
|
|
let BooleanResult = typeof fn === "function";
|
|
if (typeof fn === "function") {
|
|
const prototype = fn.prototype;
|
|
let isReactComponent;
|
|
if (prototype != null) {
|
|
isReactComponent = prototype.isReactComponent;
|
|
}
|
|
BooleanResult = Boolean(isReactComponent);
|
|
}
|
|
return BooleanResult;
|
|
};
|
|
export const getValidComponent = (icon) => {
|
|
let tmp = icon;
|
|
if (!noop.isValidElement(icon)) {
|
|
let element = null;
|
|
if (null != icon) {
|
|
element = noop.createElement(icon);
|
|
}
|
|
tmp = element;
|
|
}
|
|
return tmp;
|
|
};
|