MCPcopy Index your code
hub / github.com/formatjs/formatjs / compileAndWrite

Function compileAndWrite

packages/cli-lib/compile.ts:200–211  ·  view source on GitHub ↗
(
  inputFiles: string[],
  compileOpts: CompileCLIOpts = {}
)

Source from the content-addressed store, hash-verified

198 * @returns A `Promise` that resolves if file was written successfully
199 */
200export default async function compileAndWrite(
201 inputFiles: string[],
202 compileOpts: CompileCLIOpts = {}
203): Promise<void> {
204 const {outFile, ...opts} = compileOpts
205 const serializedResult = (await compile(inputFiles, opts)) + '\n'
206 if (outFile) {
207 debug('Writing output file:', outFile)
208 return outputFile(outFile, serializedResult)
209 }
210 await writeStdout(serializedResult)
211}

Callers

nothing calls this directly

Calls 2

compileFunction · 0.70
debugFunction · 0.70

Tested by

no test coverage detected