JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29064
  • Score
    100M100P100Q128218F
  • License MIT

Type checking for JSON objects

Package Exports

  • types-json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (types-json) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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