(/** @type {string} */ schemaPath)
| 320 | } |
| 321 | |
| 322 | async function toFile(/** @type {string} */ schemaPath) { |
| 323 | const buffer = await fs.readFile(schemaPath) |
| 324 | const text = buffer.toString() |
| 325 | return { |
| 326 | buffer, |
| 327 | text, |
| 328 | json: await readDataFile({ filepath: schemaPath, text }), |
| 329 | name: path.basename(schemaPath), |
| 330 | path: schemaPath.replace(/^\.\//u, ''), |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | async function readDataFile( |
| 335 | /** @type {{filepath: string, text: string }} */ obj, |
no test coverage detected