Closed cubabit closed 3 years ago
Sounds like this is a quirk of whatever editor or IDE you are using.
I set up a unit test for this, and stepped through the debugger in IntelliJ IDEA. The date object's prototype constructor is Date
. Hovering over value.date.constructor
give me Function
with some nice JSDoc comments.
I don't think there's much we can do in joiful
, maybe raise it with the developers of your source code editor?
When I use
validateAsClass
and cast a value from a string to a date, and my schema property is typed as a Date, I expect the type of the property to be a date after validating.Example
The value logged to the console is
[Function: Date]
as expected.Expected behaviour
When hovering over date (in
value.date.contructor
) the type should beDate
.Actual behaviour
When hovering over date (in
value.date.contructor
) the type isstring
.Environment
tsconfig.json