q9
This commit is contained in:
15
node_modules/loupe/lib/class.js
generated
vendored
Normal file
15
node_modules/loupe/lib/class.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import inspectObject from './object.js';
|
||||
const toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag ? Symbol.toStringTag : false;
|
||||
export default function inspectClass(value, options) {
|
||||
let name = '';
|
||||
if (toStringTag && toStringTag in value) {
|
||||
name = value[toStringTag];
|
||||
}
|
||||
name = name || value.constructor.name;
|
||||
// Babel transforms anonymous classes to the name `_class`
|
||||
if (!name || name === '_class') {
|
||||
name = '<Anonymous Class>';
|
||||
}
|
||||
options.truncate -= name.length;
|
||||
return `${name}${inspectObject(value, options)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user