Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid error when esModuleInterop enabled #16

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

cmurphy23
Copy link

@cmurphy23 cmurphy23 commented Oct 9, 2024

Hello, there are some errors in turfjs that I believe can solved by using your library, there are several open issues about it, and it has been mentioned here in #7.

I have been able to get turfjs to build with this library, I am in the process of updating the usages of the polygon-clipping project to use this project instead. When I'm finished with that I'll open up a PR there and link it here. It won't be able to be merged until this has been merged and released.

The problem this change solves is it allows typescript to run with esModuleInterop set to true. Prior to these changes, the interoperability check would fail like this:

> tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts

../../node_modules/.pnpm/[email protected]/node_modules/polyclip-ts/types/vector.d.ts:3:8 - error TS2709: Cannot use namespace 'BigNumber' as a type```

I'm not a typescript expert, so I don't completely understand the issue, but it seems as though `BigNumber` is already being used as a namespace, and this change just gives it a different name to avoid the conflict.

@cmurphy23
Copy link
Author

Made PR for turf as well: Turfjs/turf#2729

@luizbarboza luizbarboza merged commit 09ffd30 into luizbarboza:main Oct 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants