(obj: unknown)
| 28 | const formatter = { |
| 29 | __vue_custom_formatter: true, |
| 30 | header(obj: unknown) { |
| 31 | // TODO also format ComponentPublicInstance & ctx.slots/attrs in setup |
| 32 | if (!isObject(obj)) { |
| 33 | return null |
| 34 | } |
| 35 | |
| 36 | if (obj.__isVue) { |
| 37 | return ['div', vueStyle, `VueInstance`] |
| 38 | } else if (isRef(obj)) { |
| 39 | // avoid tracking during debugger accessing |
| 40 | pauseTracking() |
| 41 | const value = obj.value |
| 42 | resetTracking() |
| 43 | return [ |
| 44 | 'div', |
| 45 | {}, |
| 46 | ['span', vueStyle, genRefFlag(obj)], |
| 47 | '<', |
| 48 | formatValue(value), |
| 49 | `>`, |
| 50 | ] |
| 51 | } else if (isReactive(obj)) { |
| 52 | return [ |
| 53 | 'div', |
| 54 | {}, |
| 55 | ['span', vueStyle, isShallow(obj) ? 'ShallowReactive' : 'Reactive'], |
| 56 | '<', |
| 57 | formatValue(obj), |
| 58 | `>${isReadonly(obj) ? ` (readonly)` : ``}`, |
| 59 | ] |
| 60 | } else if (isReadonly(obj)) { |
| 61 | return [ |
| 62 | 'div', |
| 63 | {}, |
| 64 | ['span', vueStyle, isShallow(obj) ? 'ShallowReadonly' : 'Readonly'], |
| 65 | '<', |
| 66 | formatValue(obj), |
| 67 | '>', |
| 68 | ] |
| 69 | } |
| 70 | return null |
| 71 | }, |
| 72 | hasBody(obj: unknown) { |
| 73 | return obj && (obj as any).__isVue |
| 74 | }, |
nothing calls this directly
no test coverage detected