| 2660 | * @returns {void} |
| 2661 | */ |
| 2662 | const iterateConfig = (config, options, fn) => { |
| 2663 | for (const hookFor of Object.keys(config)) { |
| 2664 | const subConfig = config[hookFor]; |
| 2665 | for (const option of Object.keys(subConfig)) { |
| 2666 | if (option !== "_") { |
| 2667 | if (option.startsWith("!")) { |
| 2668 | if (options[option.slice(1)]) continue; |
| 2669 | } else { |
| 2670 | const value = options[option]; |
| 2671 | if ( |
| 2672 | value === false || |
| 2673 | value === undefined || |
| 2674 | (Array.isArray(value) && value.length === 0) |
| 2675 | ) { |
| 2676 | continue; |
| 2677 | } |
| 2678 | } |
| 2679 | } |
| 2680 | fn(hookFor, subConfig[option]); |
| 2681 | } |
| 2682 | } |
| 2683 | }; |
| 2684 | |
| 2685 | /** @type {Record<string, string>} */ |
| 2686 | const ITEM_NAMES = { |