X
Xata12mo ago
Raveen

Is there a easier way to handle JSONData without type checking every time

Hi Guys!, I am trying to use an serialized record object in my typescript app, but it shows an error stating that there is a possibility of the value could be JSONDataFile. So do I have to type check if it's a string every time or Is there a easier way ?
No description
1 Reply
Enemykite
Enemykite12mo ago
Hey there. We've got some docs here that might interest you. I don't know if you're working with Next JS (likely if you're serializing a lot), but this should give you an example. https://xata.io/docs/sdk/typescript/overview#serializing-xata-data-structures
Xata SDK for TypeScript and JavaScript
Use the SDK as a schema-based, schema-less, or an API client
Want results from more Discord servers?
Add your server