@sanity/util
Version:
Utilities shared across projects of Sanity
16 lines • 474 B
TypeScript
interface Options {
errorLabel: string;
}
type Parser<Type> = (line: string) => Type;
/**
* Create a safe JSON parser that is able to handle lines interrupted by an error object.
*
* This may occur when streaming NDJSON from the Export HTTP API.
*
* @internal
* @see {@link https://github.com/sanity-io/sanity/pull/1787 | Initial pull request}
*/
declare function createSafeJsonParser<Type>({
errorLabel
}: Options): Parser<Type>;
export { createSafeJsonParser };