Created
October 31, 2020 18:21
-
-
Save abinavseelan/b68d8e3c6da2fe1ccc35e1fdc96cf425 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Schema { | |
posts: Array<{ | |
id: number; | |
title: string; | |
views: number; | |
}>; | |
user: { | |
name: string; | |
}; | |
} | |
// Users define their database schema. Here `db` is typed as `Schema`. | |
// However, our problem was ensuring that the user defined schema is valid JSON. | |
const db = new CasualDB<Schema>(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment