Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ts-brand-json

streamich490.1.1TypeScript support: included

TypeScript type for JSON strings.

readme

ts-brand-json

TypeScript type for JSON strings.

import {JSON, json} from 'ts-brand-json';

const str = '{"hello": "world"}' as json<{hello: string}>;

JSON.parse(str).hello; // OK
JSON.parse(str).foo; // Error: ...