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

Dependencies (1)

Dev Dependencies (0)

    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