Files
setup-helm/node_modules/@octokit/endpoint/dist-src/util/extract-url-variable-names.js
shigupt202 18bc768116 Adding graph ql for Helm versions (#21)
* Adding graphql query to fetch latest helm release of specified type

* Updating typescript version and js file

* Fixing PR comments in release

* Adding feature flag as environment variable in release

* Changing feature flag name

* Updating files as per latest changes in master after resolving merge conflicts

* Removing non prod modules
2021-03-31 10:51:13 +05:30

12 lines
360 B
JavaScript

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), []);
}