0.1.1 • Published 6 years ago
ts-brand-json v0.1.1
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: ...