@bconnorwhite/json-types
Version:
Type checking for json objects
8 lines (7 loc) • 298 B
TypeScript
export declare type JSONObject = {
[key in string]?: JSONValue;
};
export declare type JSONValue = string | number | boolean | null | JSONObject | JSONArray;
export interface JSONArray extends Array<JSONValue> {
}
export declare function isJSONObject(object?: JSONValue): object is JSONObject;