Skip to content

Commit 3159d6e

Browse files
committed
Update commandHandlers.class.js support reference for Command class
1 parent 28d5268 commit 3159d6e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/lib/commandHandlers.class.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { getCategoriesFlags } from "./categoriesHandlers.class.js"
2+
3+
class Command {
4+
make = (url, options) => {
5+
const isOptionsCategories = getCategoriesFlags(options?.categories)
6+
const currentFlags = `${isOptionsCategories}--output json --disable-full-page-screenshot --chrome-flags="--no-sandbox --headless --disable-gpu"`
7+
const commandToRun = `lighthouse ${url} ${currentFlags}`
8+
return { commandToRun, currentFlags }
9+
}
10+
}
11+
12+
export const {
13+
make: makeCommandFromURL // deprecated: only use this for non-class implementation
14+
} = new Command()
15+
export default new Command()

0 commit comments

Comments
 (0)