MCPcopy Create free account
hub / github.com/arktypeio/arktype / unreadClassOf

Function unreadClassOf

ark/type/runtime.ts:1095–1116  ·  view source on GitHub ↗
(Ctx: IssuesClass)

Source from the content-addressed store, hash-verified

1093// prototype the errors', built with what finds them as the class itself is
1094// where a build wrote it to
1095const unreadClassOf = (Ctx: IssuesClass): IssuesClass => {
1096 class Unread {
1097 // named as the fields of errors written to wait are
1098 declare _a: CompactApply
1099 declare _d: unknown
1100 declare _f?: ArkIssue[]
1101
1102 constructor(data: unknown, config: unknown, apply: CompactApply) {
1103 this._a = apply
1104 this._d = data
1105 }
1106
1107 get _(): ArkIssue[] {
1108 return (this._f ??= issuesOf(this._a, this._d, new Ctx()))
1109 }
1110 }
1111 // a Ctx, built without the fields its constructor sets
1112 setPrototypeOf(Unread.prototype, Ctx.prototype)
1113 // keeps the prototype's own constructor, still not enumerable
1114 Unread.prototype.constructor = Ctx
1115 return Unread as never
1116}
1117
1118let unreadArkErrors: IssuesClass | undefined
1119

Callers 1

unreadOfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected