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

Method holdsElement

ark/schema/structure/sequence.ts:295–300  ·  view source on GitHub ↗

whether data has a value at `index`, a defaultable element's index, which its default leaves alone

(data: array, index: number)

Source from the content-addressed store, hash-verified

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 {
296 return (
297 index < data.length &&
298 !(this.defaultsUndefined && data[index] === undefined)
299 )
300 }
301
302 /** writes whether data has a value at `index`, which its default leaves alone if it's `defaultable` */
303 jsHoldsElement(defaultable: boolean, index: string | number): string {

Callers 2

tfElemsMethod · 0.95
applyStructMorphMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected