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

Method requiredOf

ark/schema/structure/sequence.ts:290–292  ·  view source on GitHub ↗

* an optional or defaultable element where it's required, which without * exactOptionalPropertyTypes drops the undefined it allowed, as TS's `-?` * does

(element: BaseRoot)

Source from the content-addressed store, hash-verified

288 * does
289 */
290 requiredOf(element: BaseRoot): BaseRoot {
291 return this.isLoose ? withoutUndefined(element) : element
292 }
293
294 /** whether data has a value at `index`, a defaultable element's index, which its default leaves alone */
295 holdsElement(data: array, index: number): boolean {

Callers 6

constructorMethod · 0.95
SequenceNodeClass · 0.95
requireMethod · 0.95
collectDefaultTypesMethod · 0.80
collectDefaultsFunction · 0.80
sequence.tsFile · 0.80

Calls 1

withoutUndefinedFunction · 0.90

Tested by

no test coverage detected