Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

json-brand

TypeScript branded type for a JSON string.

import {JSON, json} from 'json-pack/lib/json-brand';

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

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