mesqueeb / is-what

JS type check (TypeScript supported) functions like `isPlainObject() isArray()` etc. A simple & small integration.
https://mesqueeb.github.io/is-what/
MIT License
169 stars 18 forks source link

fix: move `types` condition to the front #33

Closed Andarist closed 1 year ago

Andarist commented 1 year ago

I moved types condition to the front. package.json#exports are order-sensitive - they are always matched from the top to the bottom. When a match is found then it should be used and no further matching should occur.

Right now, the current setup works in TypeScript but it's considered a bug and it should not be relied upon, see the thread and the comment here. For that reason, I would like to fix all popular packages that misconfigured their exports this way so the bug can be fixed in TypeScript.

⚠️ this PR focuses solely on fixing "🐛 Used fallback condition" problem but the "⚠️ ESM (dynamic import only)" and "👺 Masquerading as ESM" remain here. You can check the reported errors here

mesqueeb commented 1 year ago

@Andarist this should be released already. Let me know if you find the issue to be persistent.

Andarist commented 1 year ago

This problem is gone 🎉 See the arethetypeswrong

mesqueeb commented 1 year ago

@Andarist can you help me fix the final issue as per than url you shared? 🙇🏼‍♂️ I tried researching but it's a bit over my head. 😭