MCPcopy
hub / github.com/prisma/prisma / ObjectField

Class ObjectField

packages/client/src/runtime/core/errorRendering/ObjectField.ts:7–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5
6const separator = ': '
7export class ObjectField implements ErrorBasicBuilder, Field {
8 hasError = false
9 constructor(
10 readonly name: string,
11 public value: Value,
12 ) {}
13
14 markAsError() {
15 this.hasError = true
16 }
17
18 getPrintWidth() {
19 return this.name.length + this.value.getPrintWidth() + separator.length
20 }
21
22 write(writer: ErrorWriter): void {
23 const name = new FormattedString(this.name)
24 if (this.hasError) {
25 name.underline().setColor(writer.context.colors.red)
26 }
27 writer.write(name).write(separator).write(this.value)
28 }
29}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…