0a5ab058a6
- Angular 12 application with PrimeNG components - 5 existing Cypress e2e test suites - SCSS styling with BEM naming convention - i18n support (10 languages) - Leaflet map integration - Complete component hierarchy and routing structure This baseline will be used for Angular → React migration.
19 lines
597 B
JavaScript
19 lines
597 B
JavaScript
import getFuncName from 'get-func-name'
|
|
import inspectObject from './object'
|
|
|
|
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 || getFuncName(value.constructor)
|
|
// Babel transforms anonymous classes to the name `_class`
|
|
if (!name || name === '_class') {
|
|
name = '<Anonymous Class>'
|
|
}
|
|
options.truncate -= name.length
|
|
return `${name}${inspectObject(value, options)}`
|
|
}
|