formatCommitMessage() — react Function Reference
Architecture documentation for the formatCommitMessage() function in update-commit-message.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 05ec0d08_58dd_3ae4_fd0f_380535413bda["formatCommitMessage()"] ee0098d8_eed2_b4bd_b150_b52e5e2192fe["update-commit-message.js"] 05ec0d08_58dd_3ae4_fd0f_380535413bda -->|defined in| ee0098d8_eed2_b4bd_b150_b52e5e2192fe d91bd2cb_8a1b_df44_044b_8afb70e50d23["filterMsg()"] d91bd2cb_8a1b_df44_044b_8afb70e50d23 -->|calls| 05ec0d08_58dd_3ae4_fd0f_380535413bda style 05ec0d08_58dd_3ae4_fd0f_380535413bda fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/scripts/update-commit-message.js lines 38–63
function formatCommitMessage(str) {
let formattedStr = '';
let line = '';
const trim = str.replace(/(\r\n|\n|\r)/gm, ' ').trim();
if (!trim) {
return '';
}
// Split the string into words
const words = trim.split(' ');
// Iterate over each word
for (let i = 0; i < words.length; i++) {
// If adding the next word doesn't exceed the line length limit, add it to the line
if ((line + words[i]).length <= 80) {
line += words[i] + ' ';
} else {
// Otherwise, add the line to the formatted string and start a new line
formattedStr += line + '\n';
line = words[i] + ' ';
}
}
// Add the last line to the formatted string
formattedStr += line;
return formattedStr;
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does formatCommitMessage() do?
formatCommitMessage() is a function in the react codebase, defined in compiler/scripts/update-commit-message.js.
Where is formatCommitMessage() defined?
formatCommitMessage() is defined in compiler/scripts/update-commit-message.js at line 38.
What calls formatCommitMessage()?
formatCommitMessage() is called by 1 function(s): filterMsg.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free