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

Function validateUrl

out/cli.cjs:25399–25407  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

25397 return useNativeURL ? new URL3(relative, base) : parseUrl(url2.resolve(base, relative));
25398 }
25399 function validateUrl(input) {
25400 if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
25401 throw new InvalidUrlError({ input: input.href || input });
25402 }
25403 if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
25404 throw new InvalidUrlError({ input: input.href || input });
25405 }
25406 return input;
25407 }
25408 function spreadUrlObject(urlObject, target) {
25409 var spread3 = target || {};
25410 for (var key of preservedUrlFields) {

Callers 2

request3Function · 0.85
parseUrlFunction · 0.85

Calls 1

testMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…