UNPKG

889 BTypeScriptView Raw
1// Type definitions for json-parse-better-errors 1.0
2// Project: https://github.com/zkat/json-parse-better-errors#readme
3// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6export = json_parse_better_errors;
7
8/**
9 * Converts a JavaScript Object Notation (JSON) string into an object.
10 * @param text A valid JSON string.
11 * @param reviver A function that transforms the results. This function is called for each member of the object.
12 * If a member contains nested objects, the nested objects are transformed before the parent object is.
13 * @param context The number of characters to display in each direction around the position of an error.
14 */
15declare function json_parse_better_errors(
16 txt: string,
17 reviver?: (key: string, value: any) => any,
18 context?: number): any;