(chunks)
| 467 | * @returns {ChunkFilterFn | undefined} the chunk filter function |
| 468 | */ |
| 469 | const normalizeChunksFilter = (chunks) => { |
| 470 | if (chunks === "initial") { |
| 471 | return INITIAL_CHUNK_FILTER; |
| 472 | } |
| 473 | if (chunks === "async") { |
| 474 | return ASYNC_CHUNK_FILTER; |
| 475 | } |
| 476 | if (chunks === "all") { |
| 477 | return ALL_CHUNK_FILTER; |
| 478 | } |
| 479 | if (chunks instanceof RegExp) { |
| 480 | return (chunk) => (chunk.name ? chunks.test(chunk.name) : false); |
| 481 | } |
| 482 | if (typeof chunks === "function") { |
| 483 | return chunks; |
| 484 | } |
| 485 | }; |
| 486 | |
| 487 | /** |
| 488 | * Normalizes cache groups. |
no test coverage detected