MikeMcl / bignumber.js

A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic
http://mikemcl.github.io/bignumber.js
MIT License
6.63k stars 743 forks source link

BigNumber.config() typescript error #334

Closed lukaw3d closed 1 year ago

lukaw3d commented 1 year ago

BigNumber.config().DECIMAL_PLACES throws Expected 1 arguments, but got 0. in typescript

https://github.com/MikeMcl/bignumber.js/blob/d87c6606f905668445b1f5782f94adf8c02c4618/bignumber.d.ts#L1650-L1652 https://github.com/MikeMcl/bignumber.js/blob/d87c6606f905668445b1f5782f94adf8c02c4618/bignumber.d.ts#L1827-L1829

Should be

   static config(object: BigNumber.Config): BigNumber.Config; 
   static config(): BigNumber.Config;

   static set(object: BigNumber.Config): BigNumber.Config; 
   static set(): BigNumber.Config;
MikeMcl commented 1 year ago

Yes, the argument should be optional.

static config(object?: BigNumber.Config): BigNumber.Config; 

Thanks for the feedback.