1
1
import Utility from './utilities.class.js'
2
2
3
3
class Categories {
4
- getCategoriesFlags = array => {
5
- return ( ! Array . isEmpty ( array ) ?? false ) ? `--only-categories=${ lighthouseCategories ( array ?? "accessibility" ) } ` : ""
4
+ // getCategoriesFlags = array => {
5
+ getFlags = array => {
6
+ return ( ! Utility . isEmpty ( array ) ?? false ) ? `--only-categories=${ lighthouseCategories ( array ?? "accessibility" ) } ` : ""
6
7
}
7
8
8
- getCurrentCategories = categories => {
9
+ // getCurrentCategories = categories => {
10
+ getCurrent = categories => {
9
11
return categories ?? [ "accessibility" , "pwa" , "best-practices" , "performance" , "seo" ]
10
12
}
11
13
12
- lighthouseCategories = ( categories = [ ] ) => {
14
+ // lighthouseCategories = (categories = []) => {
15
+ lighthouse = ( categories = [ ] ) => {
13
16
return ( typeof categories == "string" ) ? categories : categories . join ( ',' )
14
17
}
15
18
16
- getCategoriesFromCategoriesFlags = array => {
19
+ // getCategoriesFromCategoriesFlags = array => {
20
+ getFromFlags = array => {
17
21
return ( ! Utility . isEmpty ( array ) ) ? array : undefined
18
22
}
19
23
}
20
24
21
- export const { getCategoriesFlags, lighthouseCategories, getCurrentCategories, getCategoriesFromCategoriesFlags } = new Categories ( )
22
- export default Categories
25
+ export const {
26
+ getFlags : getCategoriesFlags , // deprecated: only use this for non-class implementation
27
+ lighthouse : lighthouseCategories , // deprecated: only use this for non-class implementation
28
+ getCurrent : getCurrentCategories , // deprecated: only use this for non-class implementation
29
+ getFromFlags : getCategoriesFromCategoriesFlags // deprecated: only use this for non-class implementation
30
+ } = new Categories ( )
31
+ export default new Categories ( )
0 commit comments