MCPcopy Create free account
hub / github.com/github/gh-aw / normalizeIssueIntentLabelNames

Function normalizeIssueIntentLabelNames

actions/setup/js/issue_intents.cjs:109–125  ·  view source on GitHub ↗
(labels)

Source from the content-addressed store, hash-verified

107}
108
109function normalizeIssueIntentLabelNames(labels) {
110 if (labels === undefined) {
111 return [];
112 }
113 if (!Array.isArray(labels)) {
114 const receivedType = labels === null ? "null" : typeof labels;
115 throw new Error(`Invalid labels. Expected an array of label names or label spec objects; received ${receivedType}.`);
116 }
117
118 return labels.map((label, index) => {
119 if (typeof label === "string") {
120 return label;
121 }
122 const normalized = normalizeIssueIntentLabelSpecs([label]);
123 return normalized[0].name;
124 });
125}
126
127function getIssueIntentLabelNames(labelSpecs) {
128 return labelSpecs.map(label => label.name);

Callers 2

remove_labels.cjsFile · 0.85
add_labels.cjsFile · 0.85

Calls 1

Tested by

no test coverage detected