types-json
Type checking for JSON objects
Last updated 6 years ago by bconnorwhite .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install types-json 
SYNC missed versions from official npm registry.

types-json

NPM TypeScript Coverage Status GitHub Stars Twitter Follow

Type checking for JSON objects.

Derived from type-fest with a focus on JSON types.

Installation

yarn add types-json
npm install types-json

API

Types

import {
  isJSONValue,
  isJSONObject,
  isJSONArray,
  isString,
  isNumber,
  isBoolean,
  isNull,
  isUndefined,
  JSONObject,
  JSONValue,
  JSONArray
} from "types-json";

function isJSONValue(object?: JSONValue): boolean;

function isJSONObject(object?: JSONValue): boolean;

function isJSONArray(object?: JSONValue): boolean;

function isString(object?: JSONValue): boolean;

function isNumber(object?: JSONValue): boolean;

function isBoolean(object?: JSONValue): boolean;

function isNull(object?: JSONValue): boolean;

function isUndefined(object?: JSONValue): boolean;

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

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

interface JSONArray extends Array<JSONValue> {};

Dev DependenciesDavid


License license

MIT


Related Packages

Current Tags

  • 1.2.2                                ...           latest (6 years ago)

7 Versions

  • 1.2.2                                ...           6 years ago
  • 1.2.1                                ...           6 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.8                                ...           6 years ago
  • 1.0.7                                ...           6 years ago
  • 1.0.6                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)

Copyright 2013 - present © cnpmjs.org | Home |