Package Exports
- types-json
Readme
Types and type guards for JSON values.
If I should maintain this repo, please ⭐️
DM me on Twitter if you have questions or suggestions.
Installation
yarn add types-jsonnpm install types-jsonpnpm add types-jsonUsage
import {
isJSONValue,
isJSONObject,
isJSONArray,
isString,
isNumber,
isBoolean,
isNull,
isUndefined
} from "types-json";
isJSONObject({}); // true
isJSONArray([]); // true
isString("foo"); // true
isNumber(1); // true
isBoolean(true); // true
isNull(null); // true
isUndefined(undefined); // true
isJSONValue(undefined); // falseTypes
import {
JSONObject,
JSONValue,
JSONArray
} from "types-json";
type JSONObject = {
[key in string]?: JSONValue
};
type JSONValue = string | number | boolean | null | JSONObject | JSONArray;
interface JSONArray extends Array<JSONValue> {};Dev Dependencies
- autorepo: Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.
License 
Related Packages
- types-pkg-json: Type checking for package.json
- types-tsconfig: Type checking for tsconfig.json
- types-eslintrc: Type checking for .eslintrc.json