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

Method jsHoldsElement

ark/schema/structure/sequence.ts:303–307  ·  view source on GitHub ↗

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

(defaultable: boolean, index: string | number)

Source from the content-addressed store, hash-verified

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 {
304 return defaultable && this.defaultsUndefined ?
305 `${index} < data.length && data[${index}] !== undefined`
306 : `${index} < data.length`
307 }
308
309 /** the morphs writing its elements' defaults */
310 defMorphs: Morph[] =

Callers 3

jsElementsMethod · 0.95
jsSequenceDefaultsMethod · 0.80
jsDeleteTransformMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected