Add octokit

This commit is contained in:
Rachael Sewell
2019-08-06 20:56:08 -07:00
parent ba3261b69d
commit 332696c680
122 changed files with 55351 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
const urlVariableRegex = /\{[^}]+\}/g;
function removeNonChars(variableName) {
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
}
export function extractUrlVariableNames(url) {
const matches = url.match(urlVariableRegex);
if (!matches) {
return [];
}
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
}