mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
show object constructor name in value explorer
This commit is contained in:
@@ -121,13 +121,17 @@ export const header = object => {
|
|||||||
} else if(has_custom_toString(object)) {
|
} else if(has_custom_toString(object)) {
|
||||||
return object.toString()
|
return object.toString()
|
||||||
} else {
|
} else {
|
||||||
|
const prefix =
|
||||||
|
(object.constructor.name == null || object.constructor.name == 'Object')
|
||||||
|
? ''
|
||||||
|
: object.constructor.name + ' '
|
||||||
const inner = displayed_entries(object)
|
const inner = displayed_entries(object)
|
||||||
.map(([k,v]) => {
|
.map(([k,v]) => {
|
||||||
const value = stringify_for_header(v)
|
const value = stringify_for_header(v)
|
||||||
return `${k}: ${value}`
|
return `${k}: ${value}`
|
||||||
})
|
})
|
||||||
.join(', ')
|
.join(', ')
|
||||||
return `{${inner}}`
|
return `${prefix} {${inner}}`
|
||||||
}
|
}
|
||||||
} else if(typeof(object) == 'function') {
|
} else if(typeof(object) == 'function') {
|
||||||
// TODO clickable link, 'fn', cursive
|
// TODO clickable link, 'fn', cursive
|
||||||
|
|||||||
Reference in New Issue
Block a user