Type-safe JSON strings
npm install json-bondJSON bond provides a way to add type-safety to JSON strings.
The library is available as an npm package. To install JSON bond, run:
``sh`
npm install json-bond --saveOr using Yarn:
yarn add json-bond
`ts
import { JSONBond, parse, stringify } from 'json-bond'
type Abc = { [char: string]: number }
const abc: Abc = { a: 1, b: 2 }
const json = stringify(abc)
//=> JSONBond
const result = parse(json)
//=> Abc
``
See the changelog.