MCPcopy
hub / github.com/srcbookdev/srcbook / getValidationError

Function getValidationError

packages/web/src/components/use-package-json.tsx:12–20  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

10import useEffectOnce from './use-effect-once';
11
12function getValidationError(source: string) {
13 try {
14 JSON.parse(source);
15 return null;
16 } catch (e) {
17 const err = e as Error;
18 return err.message;
19 }
20}
21
22export interface PackageJsonContextValue {
23 source: string;

Callers 2

PackageJsonProviderFunction · 0.70
onChangeSourceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected