MCPcopy Create free account
hub / github.com/Kong/insomnia / isValidJSONString

Function isValidJSONString

packages/insomnia/src/ui/utils/string-check.ts:1–8  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

1export const isValidJSONString = (input: string): boolean => {
2 try {
3 JSON.parse(input);
4 return true;
5 } catch {
6 return false;
7 }
8};
9
10export const isBase64String = (str: string) => {
11 // Refer: https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript

Callers 1

parseConfigValueFunction · 0.90

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected