MCPcopy Create free account
hub / github.com/github/awesome-copilot / parseIssueFormSections

Function parseIssueFormSections

eng/external-plugin-intake.mjs:75–89  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

73}
74
75function parseIssueFormSections(body) {
76 const normalized = normalizeMultilineText(body);
77 const sections = new Map();
78 const matches = [...normalized.matchAll(/^###\s+(.+)$/gm)];
79
80 for (let index = 0; index < matches.length; index += 1) {
81 const heading = matches[index][1].trim();
82 const start = matches[index].index + matches[index][0].length;
83 const end = index + 1 < matches.length ? matches[index + 1].index : normalized.length;
84 const content = normalized.slice(start, end).trim();
85 sections.set(heading, content);
86 }
87
88 return sections;
89}
90
91function normalizeGitHubRepo(value) {
92 if (!value) {

Callers 1

Calls 1

normalizeMultilineTextFunction · 0.85

Tested by

no test coverage detected