json-order
Version:
Control the order of properties in JSON via a lookup object - including nested properties.
12 lines (11 loc) • 603 B
TypeScript
import { OrderedParseResult } from './models';
/**
* Parse a JSON string and generate a map
*
* @param jsonString a json string
* @param prefix a non-empty `string` that controls what the key prefix value is in the generated map. Defaults to `$`.
* @param separator a non-empty `string` that controls what the key separator is in the generated map. Defaults to `~`.
* @returns an object containing the parsed `object: T` and the `map: PropertyMap`
*/
declare const parse: <T extends object>(jsonString: string, prefix?: string, separator?: string) => OrderedParseResult<T>;
export default parse;