MCPcopy Create free account
hub / github.com/Snapchat/Valdi / normalizeUrl

Method normalizeUrl

apps/webview_example/WebViewExample.tsx:107–116  ·  view source on GitHub ↗
(rawUrl: string)

Source from the content-addressed store, hash-verified

105 }
106
107 private normalizeUrl(rawUrl: string): string {
108 const trimmedUrl = rawUrl.trim();
109 if (trimmedUrl.length === 0) {
110 return SNAPCHAT_URL;
111 }
112 if (trimmedUrl.indexOf('://') >= 0) {
113 return trimmedUrl;
114 }
115 return `https://${trimmedUrl}`;
116 }
117}
118
119const styles = {

Callers 1

loadUrlMethod · 0.95

Calls 2

trimMethod · 0.45
indexOfMethod · 0.45

Tested by

no test coverage detected