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

Method findAll

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

208 * Return this construct and all of its children in the given order
209 */
210 public findAll(order: ConstructOrder = ConstructOrder.PREORDER): IConstruct[] {
211 const ret = new Array<IConstruct>();
212 visit(this.host);
213 return ret;
214
215 function visit(c: IConstruct) {
216 if (order === ConstructOrder.PREORDER) {
217 ret.push(c);
218 }
219
220 for (const child of c.node.children) {
221 visit(child);
222 }
223
224 if (order === ConstructOrder.POSTORDER) {
225 ret.push(c);
226 }
227 }
228 }
229
230 /**
231 * 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