An open API service indexing awesome lists of open source software.

https://github.com/streamich/ts-brand-json

TypeScript type for JSON-in-a-string
https://github.com/streamich/ts-brand-json

Last synced: 11 months ago
JSON representation

TypeScript type for JSON-in-a-string

Awesome Lists containing this project

README

          

# ts-brand-json

TypeScript type for JSON strings.

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