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

Function extractAndWrite

packages/cli-lib/extract.ts:409–420  ·  view source on GitHub ↗
(
  files: readonly string[],
  extractOpts: ExtractCLIOptions
)

Source from the content-addressed store, hash-verified

407 * @returns A Promise that resolves if output file was written successfully
408 */
409export default async function extractAndWrite(
410 files: readonly string[],
411 extractOpts: ExtractCLIOptions
412): Promise<void> {
413 const {outFile, ...opts} = extractOpts
414 const serializedResult = (await extract(files, opts)) + '\n'
415 if (outFile) {
416 debug('Writing output file:', outFile)
417 return outputFile(outFile, serializedResult)
418 }
419 await writeStdout(serializedResult)
420}

Callers

nothing calls this directly

Calls 2

extractFunction · 0.85
debugFunction · 0.70

Tested by

no test coverage detected