MCPcopy Index your code
hub / github.com/atomicdata-dev/atomic-data-browser / tryValidURL

Function tryValidURL

lib/src/client.ts:116–122  ·  view source on GitHub ↗
(subject: string)

Source from the content-addressed store, hash-verified

114
115/** Throws an error if the URL is not valid */
116export function tryValidURL(subject: string): void {
117 try {
118 new URL(subject);
119 } catch (e) {
120 throw new Error(`Not a valid URL: ${subject}. ${e}`);
121 }
122}
123
124/** Returns true if a URL is valid. */
125export function isValidURL(subject: string): boolean {

Callers 8

setSubjectMethod · 0.90
renameSubjectMethod · 0.90
setServerUrlMethod · 0.90
constructorMethod · 0.90
validateFunction · 0.90
handleChangeFunction · 0.90
fetchResourceFunction · 0.85
isValidURLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected