Skip to content

Conversation

@Demivan
Copy link
Contributor

@Demivan Demivan commented Nov 16, 2025

Right now, you can assign anything to FluentVariable. This is because TemporalObject only requires toString() and everything in JS has it in the prototype.

PR makes TemporalObject stricter by requiring either epochMilliseconds (Instant), calendarId (all the date types) or hour,minute,second (PlainTime).

This is not perfect, but at least it restores some type safety for FluentVariable.

@eemeli
Copy link
Member

eemeli commented Nov 27, 2025

Sorry for not getting to this earlier. It looks like there's at least one type assertion that we can remove if making TemporalObject more specific?

@Demivan
Copy link
Contributor Author

Demivan commented Nov 27, 2025

You are right. I have fixed that now

@eemeli eemeli merged commit c5c8ab9 into projectfluent:main Nov 27, 2025
3 checks passed
@Demivan Demivan deleted the fix-temporal-types branch December 1, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants