@fgv/ts-json-base
v4.0.2
Published
Typescript types and basic functions for working with json
Downloads
3,882
Readme
Summary
Assorted JSON-related typescript utilities that I'm tired of copying from project to project.
Installation
With npm:
npm install ts-json
Overview
Type-Safe JSON
A handful of types express valid JSON as typescript types:
type JsonPrimitive = boolean | number | string | null;
interface JsonObject { [key: string]: JsonValue }
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
interface JsonArray extends Array<JsonValue> { }