MCPcopy Create free account
hub / github.com/di-sukharev/opencommit / queryEncoder

Function queryEncoder

out/cli.cjs:33351–33365  ·  view source on GitHub ↗
(f4)

Source from the content-addressed store, hash-verified

33349 return args.filter(Boolean).join("&");
33350 }
33351 function queryEncoder(f4) {
33352 const bulkEncode = function(values, options) {
33353 var _a5, _b2;
33354 const opts = {
33355 ...options,
33356 explode: (_a5 = options === null || options === void 0 ? void 0 : options.explode) !== null && _a5 !== void 0 ? _a5 : true,
33357 charEncoding: (_b2 = options === null || options === void 0 ? void 0 : options.charEncoding) !== null && _b2 !== void 0 ? _b2 : "percent"
33358 };
33359 const encoded = Object.entries(values).map(([key, value]) => {
33360 return f4(key, value, opts);
33361 });
33362 return queryJoin(...encoded);
33363 };
33364 return bulkEncode;
33365 }
33366 exports2.encodeJSONQuery = queryEncoder(encodeJSON);
33367 exports2.encodeFormQuery = queryEncoder(exports2.encodeForm);
33368 exports2.encodeSpaceDelimitedQuery = queryEncoder(exports2.encodeSpaceDelimited);

Calls

no outgoing calls

Tested by

no test coverage detected