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

Method findAll

src/construct.ts:223–241  ·  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

221 * Return this construct and all of its children in the given order
222 */
223 public findAll(order: ConstructOrder = ConstructOrder.PREORDER): IConstruct[] {
224 const ret = new Array<IConstruct>();
225 visit(this.host);
226 return ret;
227
228 function visit(c: IConstruct) {
229 if (order === ConstructOrder.PREORDER) {
230 ret.push(c);
231 }
232
233 for (const child of c.node.children) {
234 visit(child);
235 }
236
237 if (order === ConstructOrder.POSTORDER) {
238 ret.push(c);
239 }
240 }
241 }
242
243 /**
244 * 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