bignumber.js icon indicating copy to clipboard operation
bignumber.js copied to clipboard

change return type from "BigNumber" to "this"

Open ozum opened this issue 1 year ago • 0 comments

The hard-coded return type "BigNumber" prevents subclasses from working correctly with TypeScript types when superclass methods are called.

See #368, this PR closes #368

Note: I didn't change the return type of static isBigNumber(value: any): value is BigNumber; because its name implies checking whether the instance is a specifically BigNumber. Also, it works in subclasses as expected because all subclasses are also instances of BigNumber.

ozum avatar Mar 12 '24 11:03 ozum