MCPcopy
hub / github.com/ajv-validator/ajv / fail

Method fail

lib/compile/validate/index.ts:402–412  ·  view source on GitHub ↗
(condition?: Code)

Source from the content-addressed store, hash-verified

400 }
401
402 fail(condition?: Code): void {
403 if (condition === undefined) {
404 this.error()
405 if (!this.allErrors) this.gen.if(false) // this branch will be removed by gen.optimize
406 return
407 }
408 this.gen.if(condition)
409 this.error()
410 if (this.allErrors) this.gen.endIf()
411 else this.gen.else()
412 }
413
414 fail$data(condition: Code): void {
415 if (!this.$data) return this.fail(condition)

Callers 8

fail$dataMethod · 0.95
codeFunction · 0.80
codeFunction · 0.80
codeFunction · 0.80
codeFunction · 0.80

Calls 4

errorMethod · 0.95
ifMethod · 0.80
endIfMethod · 0.80
elseMethod · 0.80

Tested by

no test coverage detected