JSPM

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

Parse a typed JSON object.

Package Exports

  • parse-json-object

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 (parse-json-object) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

parse-json-object

npm typescript GitHub stars Twitter Follow

Parse a typed JSON object.

  • Returns undefined if unable to parse
  • Returns typed JSON object if successful

Installation

yarn add parse-json-object
npm install parse-json-object

API

Types

import parse, {
  isJSONObject,
  JSONObject,
  JSONValue,
  JSONArray
} from "parse-json-object";

function parse<T extends JSONObject>(json?: string) => T | undefined;

function isJSONObject(object?: JSONValue): object is JSONObject;

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

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

interface JSONArray extends Array<JSONValue> {};

Dependenciesdependencies


Dev DependenciesDavid


License license

MIT