MCPcopy Create free account
hub / github.com/processing/p5.js / get

Method get

src/strands/strands_node.js:168–185  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

166 }
167
168 get(index) {
169 const nodeData = getNodeDataFromID(this.strandsContext.dag, this.id);
170
171 // Validate baseType is 'storage'
172 // For struct storage buffers, return a proxy with per-field getters/setters
173 if (nodeData.baseType === 'storage' && this._schema) {
174 return createStructArrayElementProxy(this.strandsContext, this, index, this._schema);
175 }
176
177 // Create array access node for storage and non-storage (vector) access
178 const { id, dimension } = arrayAccessNode(
179 this.strandsContext,
180 this,
181 index,
182 'read'
183 );
184 return createStrandsNode(id, dimension, this.strandsContext);
185 }
186
187 set(index, value) {
188 // Validate baseType is 'storage' and has _originalIdentifier

Callers 6

getFunction · 0.45
addCopyingAndReturnFunction · 0.45
getOrCreateUniformNodeFunction · 0.45
getBuiltinGlobalNodeFunction · 0.45

Calls 4

getNodeDataFromIDFunction · 0.90
arrayAccessNodeFunction · 0.90
createStrandsNodeFunction · 0.85

Tested by

no test coverage detected