* Checks whether this chunk contains the chunk graph. * @param {ChunkGraph} chunkGraph the chunk graph * @param {string} type option name * @param {boolean=} includeDirectChildren include direct children (by default only children of async children are included) * @param {ChunkFilterPredicate
(chunkGraph, type, includeDirectChildren, filterFn)
| 944 | * @returns {boolean} true when the child is of type order, otherwise false |
| 945 | */ |
| 946 | hasChildByOrder(chunkGraph, type, includeDirectChildren, filterFn) { |
| 947 | if (includeDirectChildren) { |
| 948 | /** @type {Chunks} */ |
| 949 | const chunks = new Set(); |
| 950 | for (const chunkGroup of this.groupsIterable) { |
| 951 | for (const chunk of chunkGroup.chunks) { |
| 952 | chunks.add(chunk); |
| 953 | } |
| 954 | } |
| 955 | for (const chunk of chunks) { |
| 956 | const data = chunk.getChildIdsByOrders(chunkGraph, filterFn); |
| 957 | if (data[type] !== undefined) return true; |
| 958 | } |
| 959 | } |
| 960 | |
| 961 | for (const chunk of this.getAllAsyncChunks()) { |
| 962 | const data = chunk.getChildIdsByOrders(chunkGraph, filterFn); |
| 963 | if (data[type] !== undefined) return true; |
| 964 | } |
| 965 | |
| 966 | return false; |
| 967 | } |
| 968 | } |
| 969 | |
| 970 | module.exports = Chunk; |
no test coverage detected