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

Function isValidUrl

valdi/vscode_debugger/src/common/urlUtils.ts:174–181  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

172}
173
174export function isValidUrl(url: string): boolean {
175 try {
176 new URL(url);
177 return true;
178 } catch (e) {
179 return false;
180 }
181}
182
183export function escapeForRegExp(s: string): string {
184 const chars = '^[]{}()\\.^$*+?|-,';

Callers 3

shouldResolveSourceMapFunction · 0.90
standardizeMatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected