Home / Function/ parsePullRequestNumber() — react Function Reference

parsePullRequestNumber() — react Function Reference

Architecture documentation for the parsePullRequestNumber() function in update-commit-message.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  a3b7f8c7_76b8_9fea_d70f_7a74cc7216c1["parsePullRequestNumber()"]
  ee0098d8_eed2_b4bd_b150_b52e5e2192fe["update-commit-message.js"]
  a3b7f8c7_76b8_9fea_d70f_7a74cc7216c1 -->|defined in| ee0098d8_eed2_b4bd_b150_b52e5e2192fe
  e25ea7c2_a04f_a561_fa20_da34a1c0b075["main()"]
  e25ea7c2_a04f_a561_fa20_da34a1c0b075 -->|calls| a3b7f8c7_76b8_9fea_d70f_7a74cc7216c1
  style a3b7f8c7_76b8_9fea_d70f_7a74cc7216c1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/scripts/update-commit-message.js lines 102–122

function parsePullRequestNumber(text) {
  if (!text) {
    return null;
  }
  const ghstackUrlRegex =
    /https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/pull\/(\d+)/;
  const ghstackMatch = text.match(ghstackUrlRegex);
  if (ghstackMatch) {
    return ghstackMatch[1];
  }
  const firstLine = text.split('\n').filter(text => text.trim().length > 0)[0];
  if (firstLine == null) {
    return null;
  }
  const prNumberRegex = /\(#(\d{3,})\)\s*$/;
  const prNumberMatch = firstLine.match(prNumberRegex);
  if (prNumberMatch) {
    return prNumberMatch[1];
  }
  return null;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does parsePullRequestNumber() do?
parsePullRequestNumber() is a function in the react codebase, defined in compiler/scripts/update-commit-message.js.
Where is parsePullRequestNumber() defined?
parsePullRequestNumber() is defined in compiler/scripts/update-commit-message.js at line 102.
What calls parsePullRequestNumber()?
parsePullRequestNumber() is called by 1 function(s): main.

Analyze Your Own Codebase

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

Try Supermodel Free