Closed pixelzoom closed 1 month ago
@zepumph offered to do this one, thank you!
Hows that @pixelzoom?
The only thing I didn't like was the type cast in
I tried using satisfies Units
, but it didn't cast it into a Units (though it would type error if pm wasn't a unit). Perhaps as
is best?
The only thing I didn't like was the type cast in ...
I eliminated the need for that cast in https://github.com/phetsims/gas-properties/commit/46dd550797647a29f45be62291c415805a43bff1.
units.ts looks great, thanks for doing this. At first I wasn't sure if const units
was still needed. I had originally thought that it would be deleted, and the file renamed to Units.ts. But I guess that const units
still has value for JavaScript code.
Closing.
... so that we can take advantage of type checking for Property's
units
option, instead of waiting for a runtime failure.units.ts would be replaced by Units.ts, something like this:
And in ReadOnlyProperty.ts: