MCPcopy
hub / github.com/AndrewWalsh/openapi-devtools / isValidURL

Function isValidURL

src/utils/helpers.ts:10–17  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

8const isJSONFile = (url: string): boolean =>
9 url.toLowerCase().endsWith(".json");
10const isValidURL = (url: string): boolean => {
11 try {
12 new URL(url);
13 return true;
14 } catch (e) {
15 return false;
16 }
17};
18
19const isValidJSONString = (content: string): boolean => {
20 try {

Callers 1

isValidRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected