* Gets all async chunks. * @returns {Chunks} a set of all the async chunks
()
| 656 | * @returns {Chunks} a set of all the async chunks |
| 657 | */ |
| 658 | getAllAsyncChunks() { |
| 659 | /** @type {Queue} */ |
| 660 | const queue = new Set(); |
| 661 | /** @type {Chunks} */ |
| 662 | const chunks = new Set(); |
| 663 | |
| 664 | const initialChunks = intersect( |
| 665 | Array.from(this.groupsIterable, (g) => new Set(g.chunks)) |
| 666 | ); |
| 667 | |
| 668 | /** @type {Queue} */ |
| 669 | const initialQueue = new Set(this.groupsIterable); |
| 670 | |
| 671 | for (const chunkGroup of initialQueue) { |
| 672 | for (const child of chunkGroup.childrenIterable) { |
| 673 | if (child instanceof Entrypoint) { |
| 674 | initialQueue.add(child); |
| 675 | } else { |
| 676 | queue.add(child); |
| 677 | } |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | for (const chunkGroup of queue) { |
| 682 | for (const chunk of chunkGroup.chunks) { |
| 683 | if (!initialChunks.has(chunk)) { |
| 684 | chunks.add(chunk); |
| 685 | } |
| 686 | } |
| 687 | for (const child of chunkGroup.childrenIterable) { |
| 688 | queue.add(child); |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | return chunks; |
| 693 | } |
| 694 | |
| 695 | /** |
| 696 | * Gets all initial chunks. |
no test coverage detected