mic-inspector
Version:
A react inspector which a most similar of Chorme DevTools inspector
29 lines (28 loc) • 807 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isObjectOrFunction = void 0;
/**
* Return a boolean represents whether the property value is an object or a function
* @param propertyValue Property value
* @param descriptor Property decsriptor
*/
exports.isObjectOrFunction = function (propertyValue, descriptor) {
// if descriptor existed
if (descriptor) {
// if the get accessor existed
if (descriptor.get) {
return false;
}
propertyValue = descriptor.value;
}
switch (typeof propertyValue) {
case 'string':
case 'boolean':
case 'number':
case 'symbol':
case 'bigint':
case 'undefined':
return false;
}
return propertyValue !== null;
};