ts-brand-json
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    16
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    16
  • 0.1.0
    1

Package Sidebar

Install

npm i ts-brand-json

Weekly Downloads

17

Version

0.1.1

License

none

Unpacked Size

990 B

Total Files

4

Last publish

Collaborators

  • streamich