MCPcopy Index your code
hub / github.com/callstack/agent-device / normalizeBaseUrl

Function normalizeBaseUrl

src/remote/daemon-proxy.ts:256–266  ·  view source on GitHub ↗
(value: string, label: string)

Source from the content-addressed store, hash-verified

254}
255
256function normalizeBaseUrl(value: string, label: string): string {
257 try {
258 const parsed = new URL(value);
259 if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
260 throw new Error('unsupported protocol');
261 }
262 return parsed.toString().replace(/\/+$/, '');
263 } catch (error) {
264 throw new AppError('INVALID_ARGS', `Invalid ${label}`, { [label]: value }, error);
265 }
266}
267
268function normalizeToken(value: string, label: string): string {
269 const token = value.trim();

Callers 1

normalizeProxyOptionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected