MCPcopy
hub / github.com/di-sukharev/opencommit / serializeURL

Function serializeURL

out/cli.cjs:4530–4557  ·  view source on GitHub ↗
(url2, excludeFragment)

Source from the content-addressed store, hash-verified

4528 return true;
4529 };
4530 function serializeURL(url2, excludeFragment) {
4531 let output = `${url2.scheme}:`;
4532 if (url2.host !== null) {
4533 output += "//";
4534 if (url2.username !== "" || url2.password !== "") {
4535 output += url2.username;
4536 if (url2.password !== "") {
4537 output += `:${url2.password}`;
4538 }
4539 output += "@";
4540 }
4541 output += serializeHost(url2.host);
4542 if (url2.port !== null) {
4543 output += `:${url2.port}`;
4544 }
4545 }
4546 if (url2.host === null && !hasAnOpaquePath(url2) && url2.path.length > 1 && url2.path[0] === "") {
4547 output += "/.";
4548 }
4549 output += serializePath(url2);
4550 if (url2.query !== null) {
4551 output += `?${url2.query}`;
4552 }
4553 if (!excludeFragment && url2.fragment !== null) {
4554 output += `#${url2.fragment}`;
4555 }
4556 return output;
4557 }
4558 function serializeOrigin(tuple) {
4559 let result = `${tuple.scheme}://`;
4560 result += serializeHost(tuple.host);

Callers

nothing calls this directly

Calls 3

serializeHostFunction · 0.85
hasAnOpaquePathFunction · 0.85
serializePathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…