( groups: Group[], onlyCategories: string | string[], )
| 135 | } |
| 136 | |
| 137 | export function validateOnlyCategories( |
| 138 | groups: Group[], |
| 139 | onlyCategories: string | string[], |
| 140 | ): boolean { |
| 141 | const missingCategories = toArray(onlyCategories).filter(slug => |
| 142 | groups.every(group => group.slug !== slug), |
| 143 | ); |
| 144 | if (missingCategories.length > 0) { |
| 145 | throw new NotImplementedError('Categories', missingCategories); |
| 146 | } |
| 147 | return true; |
| 148 | } |
| 149 | |
| 150 | export type FilterOptions = Partial< |
| 151 | Pick<LighthouseCliFlags, 'onlyAudits' | 'onlyCategories' | 'skipAudits'> |
no test coverage detected