Home / Function/ writeOutputToString() — react Function Reference

writeOutputToString() — react Function Reference

Architecture documentation for the writeOutputToString() function in reporter.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  84944777_d7ed_3ce5_35bb_d71af47d5891["writeOutputToString()"]
  0e6b4c6b_7bcc_eac7_3f6d_ff9990f24223["reporter.ts"]
  84944777_d7ed_3ce5_35bb_d71af47d5891 -->|defined in| 0e6b4c6b_7bcc_eac7_3f6d_ff9990f24223
  5e39198b_b086_5261_de7a_7fc49349ecb6["transformFixture()"]
  5e39198b_b086_5261_de7a_7fc49349ecb6 -->|calls| 84944777_d7ed_3ce5_35bb_d71af47d5891
  19b4bc66_e2ae_9a80_61b8_d79b0a1b7586["wrapWithTripleBackticks()"]
  84944777_d7ed_3ce5_35bb_d71af47d5891 -->|calls| 19b4bc66_e2ae_9a80_61b8_d79b0a1b7586
  style 84944777_d7ed_3ce5_35bb_d71af47d5891 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/snap/src/reporter.ts lines 21–65

export function writeOutputToString(
  input: string,
  compilerOutput: string | null,
  evaluatorOutput: string | null,
  logs: string | null,
  errorMessage: string | null,
) {
  // leading newline intentional
  let result = `
## Input

${wrapWithTripleBackticks(input, 'javascript')}
`; // trailing newline + space internional

  if (compilerOutput != null) {
    result += `
## Code

${wrapWithTripleBackticks(compilerOutput, 'javascript')}
`;
  } else {
    result += '\n';
  }

  if (logs != null) {
    result += `
## Logs

${wrapWithTripleBackticks(logs, null)}
`;
  }

  if (errorMessage != null) {
    result += `
## Error

${wrapWithTripleBackticks(errorMessage.replace(/^\/.*?:\s/, ''))}
          \n`;
  }
  result += `      `;
  if (evaluatorOutput != null) {
    result += SPROUT_SEPARATOR + evaluatorOutput;
  }
  return result;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does writeOutputToString() do?
writeOutputToString() is a function in the react codebase, defined in compiler/packages/snap/src/reporter.ts.
Where is writeOutputToString() defined?
writeOutputToString() is defined in compiler/packages/snap/src/reporter.ts at line 21.
What does writeOutputToString() call?
writeOutputToString() calls 1 function(s): wrapWithTripleBackticks.
What calls writeOutputToString()?
writeOutputToString() is called by 1 function(s): transformFixture.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free