MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / readJson

Function readJson

javascript/selenium-webdriver/generate_bidi.mjs:245–252  ·  view source on GitHub ↗
(fileArg, label)

Source from the content-addressed store, hash-verified

243}
244
245function readJson(fileArg, label) {
246 const path = resolveInputPath(fileArg)
247 if (!existsSync(path)) {
248 console.error(`Error: ${label} file not found: ${path}`)
249 process.exit(1)
250 }
251 return JSON.parse(readFileSync(path, 'utf8'))
252}
253
254function writeJson(fileArg, data, label, pretty = false) {
255 const out = resolve(fileArg)

Callers 1

mainFunction · 0.85

Calls 3

resolveInputPathFunction · 0.85
errorMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected