-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the cooler Date types PR #85
base: main
Are you sure you want to change the base?
the cooler Date types PR #85
Conversation
Not ready for merge, but I'm putting this out Draft, so you get CI run the tests. |
Hey, thanks for this! I had gotten sidetracked on other projects so I haven't looked at this branch in a while. |
0c1edc4
to
ddc28c5
Compare
ddc28c5
to
1b6d68b
Compare
core/src/language/typescript.rs
Outdated
@@ -84,6 +92,15 @@ impl Language for TypeScript { | |||
Ok(()) | |||
} | |||
|
|||
fn end_file(&mut self, w: &mut dyn Write) -> std::io::Result<()> { | |||
if self.has_date.load(Ordering::SeqCst) { | |||
writeln!(w, "export function TypeshareDateReviver(key, value): Date {{ return new Date(value); }}")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose for this function? Why does it need to take key
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a provided function that can be passed to JSON.parse
to revive JSON into an actual Date
type rather than just an object. The function signature is necessary as it is what JSON.parse
expects
Is there any work left to be done for this? Would be quite useful for many applications |
Awesome that there is an ongoing fix. |
@CerulanLumina This is your
support-date-types
rebased onmain
, with minor TypeScript and Kotlin extras. Use as you like.