aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 464 B
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0}),exports.iterateBfs=iterateBfs;var linked_queue_1=()=>{var tmp=require("./linked-queue");return linked_queue_1=()=>tmp,tmp};function*iterateBfs(root){const queue=new(linked_queue_1()).LinkedQueue([{construct:root,parent:void 0}]);let next=queue.shift();for(;next;){for(const child of next.construct.node.children)queue.push({construct:child,parent:next.construct});yield next,next=queue.shift()}}
;