Initial import

This commit is contained in:
Chris Patterson
2019-08-03 21:34:59 -04:00
commit 62b122fb5f
568 changed files with 99070 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), []);
}