Logo
Explore Help
Register Sign In
actions/setup-node
1
0
Fork 0
You've already forked setup-node
mirror of https://gitea.com/actions/setup-node.git synced 2025-05-09 01:06:48 +08:00
Code Issues Packages Projects Releases Wiki Activity
setup-node/node_modules/@octokit/endpoint/dist-src/util/add-query-parameters.js

22 lines
622 B
JavaScript
Raw Normal View History

Add auth support (#21) * Updates * Update * Update * Update * Update * Yarn sometimes prefers npmrc, so use same token * Description * Update readme * Feedback * Add type * new toolkit and scoped registries * npmrc in RUNNER_TEMP * Dont always auth * Try exporting blank token * Get auth working for now pending runner changes * Fix string interpolation for auth token. * Don't export both userconfigs * Update authutil.js * Add single quotes for authString * Fix the registry string. * Use userconfig and append trailing slash * Keep in root of repo * Try just adding auth token * Remove auth token * Try changes again * Add tests * Npm and GPR samples * Add types
2019-08-06 18:26:04 -04:00
export function addQueryParameters(url, parameters) {
const separator = /\?/.test(url) ? "&" : "?";
const names = Object.keys(parameters);
if (names.length === 0) {
return url;
}
return (url +
separator +
names
.map(name => {
if (name === "q") {
return ("q=" +
parameters
.q.split("+")
.map(encodeURIComponent)
.join("+"));
}
return `${name}=${encodeURIComponent(parameters[name])}`;
})
.join("&"));
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 23.7.0 Page: 178ms Template: 13ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses 隐私政策 方块世界群组