extract-first-json
Version:
Extract the first JSON object or array from a string
6 lines (5 loc) • 345 B
TypeScript
import { JSONObject, JSONArray } from "parse-json-object";
export declare function extractJSONObject(text: string): JSONObject | undefined;
export declare function extractJSONArray(text: string): JSONArray | undefined;
export declare function extractJSON(text: string): JSONObject | JSONArray | undefined;
export type { JSONArray, JSONObject };