Home / Function/ processFile() — react Function Reference

processFile() — react Function Reference

Architecture documentation for the processFile() function in copyright.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  353d86b5_92e8_21ef_7bf2_fbc321fa21c4["processFile()"]
  88328c33_5eb5_8bd2_b334_c8709083a200["copyright.js"]
  353d86b5_92e8_21ef_7bf2_fbc321fa21c4 -->|defined in| 88328c33_5eb5_8bd2_b334_c8709083a200
  style 353d86b5_92e8_21ef_7bf2_fbc321fa21c4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/scripts/copyright.js lines 53–68

function processFile(file) {
  if (fs.lstatSync(file).isDirectory()) {
    return;
  }
  let source = fs.readFileSync(file, 'utf8');

  if (source.indexOf(META_COPYRIGHT_COMMENT_BLOCK) === 0) {
    return null;
  }
  if (/^\/\*\*/.test(source)) {
    source = source.replace(/\/\*\*[^\/]+\/\s+/, META_COPYRIGHT_COMMENT_BLOCK);
  } else {
    source = `${META_COPYRIGHT_COMMENT_BLOCK}${source}`;
  }
  return source;
}

Domain

Subdomains

Frequently Asked Questions

What does processFile() do?
processFile() is a function in the react codebase, defined in compiler/scripts/copyright.js.
Where is processFile() defined?
processFile() is defined in compiler/scripts/copyright.js at line 53.

Analyze Your Own Codebase

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

Try Supermodel Free