I managed to introduce my KV in bindings.d.ts so the types returned from KV.list are not unknown now. This broke my app horribly as I was taking shortcuts with mapping the result to any[]. Is there any good example of reading data from KV into typed objects? I guess I'll figure it out in the end, but if there is a good sample code, it would help a lot.
#TS KV Example
1 messages · Page 1 of 1 (latest)
Also, the original state was without bindings, using context.KV as it is in examples and ignoring TS errors.
I use Zod to validate the data I receive from KV
for example here I do it on my blog https://github.com/sergiodxa/sergiodxa.com/blob/278afdcac2810bb31ad5217826a416ebfeced54a/server/services/cn.ts#L87-L93