MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / representObj

Function representObj

src/run_tests.mjs:126–133  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

124}
125
126function representObj(val) {
127 let string = val.toString(), m, elt
128 if (/^\[object .*\]$/.test(string))
129 return representSimpleObj(val)
130 if (val.call && (m = string.match(/^\s*(function[^(]*\([^)]*\))/)))
131 return m[1] + "{…}"
132 return string
133}
134
135function constructorName(obj) {
136 if (!obj.constructor) return null

Callers 1

representFunction · 0.70

Calls 1

representSimpleObjFunction · 0.70

Tested by

no test coverage detected