e2ed
Version:
E2E testing framework over Playwright
13 lines (12 loc) • 496 B
TypeScript
type Return = Readonly<{
hasParseError: boolean;
value: unknown;
}>;
/**
* Parses `unknown` value as JSON, if needed.
* If `isValueInJsonFormat` is `true`, then parses value as JSON and saves parse error.
* If `isValueInJsonFormat` is `false`, then returns value as is.
* If `isValueInJsonFormat` is `undefined`, then safely tries to parse value as JSON.
*/
export declare const parseValueAsJsonIfNeeded: (originalValue: unknown, isValueInJsonFormat?: boolean) => Return;
export {};