ts-brand-json
TypeScript type for JSON strings.
Last updated 6 years ago by streamich .
Original npm · Tarball · package.json
$ gnpm install ts-brand-json 
SYNC missed versions from official npm registry.

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: ...

Current Tags

  • 0.1.1                                ...           latest (6 years ago)

2 Versions

  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |