You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I stringify and then parse an object with a date string, I get a date object back.
Steps to reproduce the behavior
Consider this script:
import{stringify,parse}from'telejson'interfaceFoo{readonlydate: string}constfoo: Foo={date: '2024-10-10T10:10:10Z'}constfooStringified=stringify(foo)console.log(fooStringified)constfooParsed=parse(fooStringified)console.log(fooParsed)console.log(typeoffooParsed.date)// this is a Date but I expect a string
Describe the bug
If I stringify and then parse an object with a date string, I get a date object back.
Steps to reproduce the behavior
Consider this script:
Run it and you will get the output:
Expected behavior
I expect the data integrity to be upheld. Meaning, if I serialize a string I expect a string in return. Nothing else.
Screenshots and/or logs
Environment
telejson
version 7.2.0.Additional context
The text was updated successfully, but these errors were encountered: