Skip to content

Commit

Permalink
docs: fix typescript example
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode authored Oct 23, 2023
1 parent c4ce27f commit 8841e1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type Data = {
}

const defaultData: Data = { messages: [] }
const db = await JSONFile<Data>('db.json')
const db = await JSONPreset<Data>('db.json', defaultData)

db.data.messages.push('foo') // ✅ Success
db.data.messages.push(1) // ❌ TypeScript error
Expand Down

0 comments on commit 8841e1c

Please sign in to comment.