Home / Function/ normalizeIndent() — react Function Reference

normalizeIndent() — react Function Reference

Architecture documentation for the normalizeIndent() function in ReactCompilerRuleTypescript-test.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ec0be10f_d6bd_14bb_6e45_56bae8915e5e["normalizeIndent()"]
  535f7dd0_5717_e2e5_217a_3f4a26b4e54f["ReactCompilerRuleTypescript-test.ts"]
  ec0be10f_d6bd_14bb_6e45_56bae8915e5e -->|defined in| 535f7dd0_5717_e2e5_217a_3f4a26b4e54f
  style ec0be10f_d6bd_14bb_6e45_56bae8915e5e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/eslint-plugin-react-hooks/__tests__/ReactCompilerRuleTypescript-test.ts lines 17–21

function normalizeIndent(strings: TemplateStringsArray): string {
  const codeLines = strings[0]?.split('\n') ?? [];
  const leftPadding = codeLines[1]?.match(/\s+/)![0] ?? '';
  return codeLines.map(line => line.slice(leftPadding.length)).join('\n');
}

Domain

Subdomains

Frequently Asked Questions

What does normalizeIndent() do?
normalizeIndent() is a function in the react codebase, defined in packages/eslint-plugin-react-hooks/__tests__/ReactCompilerRuleTypescript-test.ts.
Where is normalizeIndent() defined?
normalizeIndent() is defined in packages/eslint-plugin-react-hooks/__tests__/ReactCompilerRuleTypescript-test.ts at line 17.

Analyze Your Own Codebase

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

Try Supermodel Free