MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / isValidJsonString

Function isValidJsonString

packages/common/src/object.ts:3–8  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

1import { anyPass, assocPath, isEmpty, isNil, reject } from 'ramda';
2
3function isValidJsonString(value: string): boolean {
4 return (
5 (value.startsWith('{') && value.endsWith('}')) ||
6 (value.startsWith('[') && value.endsWith(']'))
7 );
8}
9function isMalformedJsonString(value: string): boolean {
10 return (
11 (value.startsWith('{') && !value.endsWith('}')) ||

Callers 1

toDotsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected