MCPcopy
hub / github.com/vuejs/core / formatValue

Function formatValue

packages/runtime-core/src/customFormatter.ts:153–165  ·  view source on GitHub ↗
(v: unknown, asRaw = true)

Source from the content-addressed store, hash-verified

151 }
152
153 function formatValue(v: unknown, asRaw = true) {
154 if (typeof v === 'number') {
155 return ['span', numberStyle, v]
156 } else if (typeof v === 'string') {
157 return ['span', stringStyle, JSON.stringify(v)]
158 } else if (typeof v === 'boolean') {
159 return ['span', keywordStyle, v]
160 } else if (isObject(v)) {
161 return ['object', { object: asRaw ? toRaw(v) : v }]
162 } else {
163 return ['span', stringStyle, String(v)]
164 }
165 }
166
167 function extractKeys(instance: ComponentInternalInstance, type: string) {
168 const Comp = instance.type

Callers 2

headerFunction · 0.85
createInstanceBlockFunction · 0.85

Calls 3

isObjectFunction · 0.90
toRawFunction · 0.90
StringInterface · 0.85

Tested by

no test coverage detected