MCPcopy Index your code
hub / github.com/SchemaStore/schemastore / toFile

Function toFile

cli.js:322–332  ·  view source on GitHub ↗
(/** @type {string} */ schemaPath)

Source from the content-addressed store, hash-verified

320}
321
322async 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
334async function readDataFile(
335 /** @type {{filepath: string, text: string }} */ obj,

Callers 4

forEachFileFunction · 0.85
taskCheckFunction · 0.85
taskCheckStrictFunction · 0.85
taskCoverageFunction · 0.85

Calls 1

readDataFileFunction · 0.85

Tested by

no test coverage detected