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

Class UnreadArkIssues

ark/aot/settingsValidators.ts:148–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146 findsOnRead ?
147 // named apart, as one bundle may hold both and a name is one class's
148 class UnreadArkIssues {
149 constructor(data, config, apply) {
150 this._p = []
151 this._a = apply
152 this._d = data
153 }
154 get _() {
155 if (!this._f) {
156 this._f = []
157 if (this._a && (this._a(this._d, this), !this._f.length))
158 this._e(this._d, "predicate", "valid", "is invalid")
159 }
160 return this._f
161 }
162 get count() {
163 return this._.length
164 }
165 get issues() {
166 return serializableIssues(this._)
167 }
168 _e(data, code, expected, message, text) {
169 this._.push({ code, path: this._p.slice(), data, expected, message })
170 if (callsSiteText) text?.(this._[this._.length - 1])
171 return void 0
172 }
173 _k(apply, data, key, ...missing) {
174 this._p.push(key)
175 const stops2 =
176 missing.length && !(key in data) ?
177 this._e(data, "required", ...missing)
178 : !apply(data[key], this)
179 this._p.pop()
180 return stops2
181 }
182 get summary() {
183 let summary = ""
184 for (const issue of this._)
185 summary += (summary && "\n") + issueLineOf(issue)
186 return summary
187 }
188 summaryIn(locale) {
189 refuseLocale(locale)
190 return this.summary
191 }
192 throw() {
193 if (namesTraversalError) throw new ThrownIssues(this)
194 if (mayDefineTraversalError && definedThrown)
195 throw new definedThrown(this)
196 const thrown = Error(this.summary)
197 thrown.name = "TraversalError"
198 throw Object.defineProperty(thrown, "arkErrors", { value: this })
199 }
200 toJSON() {
201 return this.issues.map(jsonIssueOf)
202 }
203 [Symbol.iterator]() {
204 return this.issues[Symbol.iterator]()
205 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected