(fileArg, label)
| 243 | } |
| 244 | |
| 245 | function 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 | |
| 254 | function writeJson(fileArg, data, label, pretty = false) { |
| 255 | const out = resolve(fileArg) |
no test coverage detected