1.0.5 • Published 4 years ago

@bconnorwhite/json-types v1.0.5

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

@bconnorwhite/json-types

dependencies typescript npm

Type checking for json objects

yarn add @bconnorwhite/json-types

API

import { isJSONObject, JSONObject, JSONValue, JSONArray } from "@bconnorwhite/json-types";

isJSONObject(object?: JSONValue): boolean;

type JSONObject = {
  [key in string]?: JSONValue
};

type JSONValue = string | number | boolean | null | JSONObject | JSONArray;

interface JSONArray extends Array<JSONValue> {};