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

Function isValidJSONString

src/utils/helpers.ts:19–26  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

17};
18
19const isValidJSONString = (content: string): boolean => {
20 try {
21 JSON.parse(content);
22 return true;
23 } catch (e) {
24 return false;
25 }
26};
27
28const validStatuses = new Set(["GET", "POST", "PUT", "DELETE", "PATCH"]);
29const validResourceTypes = new Set(["xhr", "fetch", "document"]);

Callers 1

isValidRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected