MCPcopy
hub / github.com/chenglou/pretext / parseBrowsers

Function parseBrowsers

scripts/keep-all-check.ts:59–75  ·  view source on GitHub ↗
(value: string | null)

Source from the content-addressed store, hash-verified

57}
58
59function parseBrowsers(value: string | null): AutomationBrowserKind[] {
60 const raw = (value ?? 'chrome,safari').trim()
61 if (raw.length === 0) return ['chrome', 'safari']
62
63 const browsers = raw
64 .split(',')
65 .map(part => part.trim().toLowerCase())
66 .filter(Boolean)
67
68 for (const browser of browsers) {
69 if (browser !== 'chrome' && browser !== 'safari' && browser !== 'firefox') {
70 throw new Error(`Unsupported browser ${browser}`)
71 }
72 }
73
74 return browsers as AutomationBrowserKind[]
75}
76
77const requestedPort = parseNumberFlag('port', 0)
78const browsers = parseBrowsers(parseStringFlag('browser'))

Callers 1

keep-all-check.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…