MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / buildURL

Function buildURL

out/cli.cjs:71628–71653  ·  view source on GitHub ↗
(url2, params, options)

Source from the content-addressed store, hash-verified

71626 }, "").join("&");
71627};
71628var AxiosURLSearchParams_default = AxiosURLSearchParams;
71629
71630// node_modules/axios/lib/helpers/buildURL.js
71631function encode2(val) {
71632 return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
71633}
71634function buildURL(url2, params, options) {
71635 if (!params) {
71636 return url2;
71637 }
71638 const _encode = options && options.encode || encode2;
71639 if (utils_default.isFunction(options)) {
71640 options = {
71641 serialize: options
71642 };
71643 }
71644 const serializeFn = options && options.serialize;
71645 let serializedParams;
71646 if (serializeFn) {
71647 serializedParams = serializeFn(params, options);
71648 } else {
71649 serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode);
71650 }
71651 if (serializedParams) {
71652 const hashmarkIndex = url2.indexOf("#");
71653 if (hashmarkIndex !== -1) {
71654 url2 = url2.slice(0, hashmarkIndex);
71655 }
71656 url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;

Callers 3

cli.cjsFile · 0.85
resolveConfig_defaultFunction · 0.85
getUriMethod · 0.85

Calls 2

toStringMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…