ripple / ripple-lib-extensions

[Deprecated] A collection of extensions to ripple-lib. Instead, see https://github.com/XRPLF/xrpl.js
https://github.com/XRPLF/xrpl.js
22 stars 31 forks source link

ripple-lib-value: migrate to new bignumber.js APIs introduced since v6 #49

Closed r0bertz closed 4 years ago

r0bertz commented 4 years ago

See https://github.com/MikeMcl/bignumber.js/blob/master/CHANGELOG.md#600

A little background:

I didn't really make it work when I bumped the version of bignumber.js. I bumped it because I thought the problem I saw was caused by bignumber.js discrepancy.

It turned out the problem I had was require('bignumber.js') doesn't work for es6 module 'bignumber.mjs'. I worked around it. Then I started seeing the API incompatibility issue. Hence this PR.

r0bertz commented 4 years ago

Please hold on. I just realized there are more APIs to fix.

r0bertz commented 4 years ago

Done. PTAL.

r0bertz commented 4 years ago

Please hold on. I just learned that this doesn't work for all packages:

resolve: { mainFields: ['browser', 'module', 'main'] }

For ws 6.0.0 upwards, browser is just a dummy file which does nothing but raises an error. I will change the way that bignumber.js is imported.

r0bertz commented 4 years ago

Never mind. Just go ahead and merge this. This is independent of what I am going to do.