| 802 | } |
| 803 | |
| 804 | function mergeStrategies( |
| 805 | base: PluginConfig["strategies"], |
| 806 | override?: Partial<PluginConfig["strategies"]>, |
| 807 | ): PluginConfig["strategies"] { |
| 808 | if (!override) { |
| 809 | return base |
| 810 | } |
| 811 | |
| 812 | return { |
| 813 | deduplication: { |
| 814 | enabled: override.deduplication?.enabled ?? base.deduplication.enabled, |
| 815 | protectedTools: [ |
| 816 | ...new Set([ |
| 817 | ...base.deduplication.protectedTools, |
| 818 | ...(override.deduplication?.protectedTools ?? []), |
| 819 | ]), |
| 820 | ], |
| 821 | }, |
| 822 | purgeErrors: { |
| 823 | enabled: override.purgeErrors?.enabled ?? base.purgeErrors.enabled, |
| 824 | turns: override.purgeErrors?.turns ?? base.purgeErrors.turns, |
| 825 | protectedTools: [ |
| 826 | ...new Set([ |
| 827 | ...base.purgeErrors.protectedTools, |
| 828 | ...(override.purgeErrors?.protectedTools ?? []), |
| 829 | ]), |
| 830 | ], |
| 831 | }, |
| 832 | } |
| 833 | } |
| 834 | |
| 835 | function mergeCompress( |
| 836 | base: PluginConfig["compress"], |