The class-transformer library converts NaN values to null values. This is documented, but it's not ideal. The work around is currently to use the attached method on component as follows:
class MyComponent {
myNum = NaN
attached () {
this.myNum = this.myNum == null ? NaN : this.myNum
}
Potentially a better solution is given a numeric type annotation like this:
@Type (() => Number) myNum = NaN
That pickle would, upon deserialization, automatically convert the null to NaN.
The class-transformer library converts NaN values to null values. This is documented, but it's not ideal. The work around is currently to use the
attached
method on component as follows:Potentially a better solution is given a numeric type annotation like this:
That pickle would, upon deserialization, automatically convert the null to NaN.