From 8841e1c49363b3de00826366e8220a4f5f798172 Mon Sep 17 00:00:00 2001 From: typicode Date: Mon, 23 Oct 2023 18:05:59 +0200 Subject: [PATCH] docs: fix typescript example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09871a3..567c68f 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ type Data = { } const defaultData: Data = { messages: [] } -const db = await JSONFile('db.json') +const db = await JSONPreset('db.json', defaultData) db.data.messages.push('foo') // ✅ Success db.data.messages.push(1) // ❌ TypeScript error