MCPcopy Create free account
hub / github.com/aws/constructs / findAll

Method findAll

src/construct.ts:197–215  ·  view source on GitHub ↗

* Return this construct and all of its children in the given order

(order: ConstructOrder = ConstructOrder.PREORDER)

Source from the content-addressed store, hash-verified

195 * Return this construct and all of its children in the given order
196 */
197 public findAll(order: ConstructOrder = ConstructOrder.PREORDER): IConstruct[] {
198 const ret = new Array<IConstruct>();
199 visit(this.host);
200 return ret;
201
202 function visit(c: IConstruct) {
203 if (order === ConstructOrder.PREORDER) {
204 ret.push(c);
205 }
206
207 for (const child of c.node.children) {
208 visit(child);
209 }
210
211 if (order === ConstructOrder.POSTORDER) {
212 ret.push(c);
213 }
214 }
215 }
216
217 /**
218 * This can be used to set contextual values.

Callers 2

withMethod · 0.95
construct.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected