The type definitions in @types/long define a type constructor like this:
new( low: number, high?: number, unsigned?: boolean ): Long;
The optional height allows users to write new Long(123). This is a problem as it makes it way too easy for callers to assume this is the correct number to Long conversion because it works for a very long time until it breaks.
The README marks heigh as required. The implementation works fine if unset because undefined | 0 is 0.
Is it safe to assume heigh is required and this can be considered a bug in the types?
The type definitions in @types/long define a type constructor like this:
The optional
heightallows users to writenew Long(123). This is a problem as it makes it way too easy for callers to assume this is the correct number to Long conversion because it works for a very long time until it breaks.The README marks
heighas required. The implementation works fine if unset becauseundefined | 0is0.Is it safe to assume
heighis required and this can be considered a bug in the types?