Home / Function/ formatTable() — react Function Reference

formatTable() — react Function Reference

Architecture documentation for the formatTable() function in flags.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  25eb2f34_01e4_b775_1294_58d726563089["formatTable()"]
  9707085b_16d7_ffa5_8026_16a476a1a065["flags.js"]
  25eb2f34_01e4_b775_1294_58d726563089 -->|defined in| 9707085b_16d7_ffa5_8026_16a476a1a065
  style 25eb2f34_01e4_b775_1294_58d726563089 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/flags/flags.js lines 450–462

function formatTable(tableData) {
  // left align the flag names.
  const maxLength = Math.max(
    ...Object.keys(tableData).map(item => item.length)
  );
  const padded = {};
  Object.keys(tableData).forEach(key => {
    const newKey = key.padEnd(maxLength, ' ');
    padded[newKey] = tableData[key];
  });

  return padded;
}

Domain

Subdomains

Frequently Asked Questions

What does formatTable() do?
formatTable() is a function in the react codebase, defined in scripts/flags/flags.js.
Where is formatTable() defined?
formatTable() is defined in scripts/flags/flags.js at line 450.

Analyze Your Own Codebase

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

Try Supermodel Free