margelo / react-native-bignumber

🔢 The fastest Big Number library for React Native
https://margelo.io
MIT License
342 stars 12 forks source link

fix: Fix `index.ts` module exports #32

Closed mrousavy closed 2 years ago

mrousavy commented 2 years ago

So the current way we export the BN class breaks TypeScript when using the lib as a normal module.

import bn from './BigNumber'
module.exports = bn

The way I'd do it would be to just forward the export;

export * from './BigNumber'

...but I think you tested that and it didn't work for you, right @Szymon20000?

If that's the case, does this change maybe work?

import * as BN from './BigNumber'
export default BN