We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
commandHandlers.class.js
1 parent 28d5268 commit 3159d6eCopy full SHA for 3159d6e
src/lib/commandHandlers.class.js
@@ -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