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

Method if

ark/schema/shared/compile.ts:147–149  ·  view source on GitHub ↗
(condition: string, then: (self: this) => this)

Source from the content-addressed store, hash-verified

145 }
146
147 if(condition: string, then: (self: this) => this): this {
148 return this.block(`if (${condition})`, then)
149 }
150
151 elseIf(condition: string, then: (self: this) => this): this {
152 return this.block(`else if (${condition})`, then)

Callers 15

switchMethod · 0.80
compileMethod · 0.80
jsAllowsMethod · 0.80
checksMethod · 0.80
jsApplyMethod · 0.80
jsIndiscMethod · 0.80
compileMethod · 0.80
jsTfMethod · 0.80
compileFunction · 0.80
jsElemTfsMethod · 0.80
jsElementsMethod · 0.80
compileMethod · 0.80

Calls 1

blockMethod · 0.95

Tested by

no test coverage detected