cure53 / DOMPurify

DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:
https://cure53.de/purify
Other
14.12k stars 733 forks source link

Moved the "import" exports to be first #1023

Closed reduckted closed 1 week ago

reduckted commented 1 week ago

Summary

Moved the "import" conditional export to be defined first.

Background & Context

Conditional exports are processed in order:

Within the "exports" object, key order is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. The general rule is that conditions should be from most specific to least specific in object order.

https://nodejs.org/api/packages.html#conditional-exports

As far as I understand, this means the "imports" should be defined first so that it takes precedence over "require" or "default".

Thank you @ghiscoding for pointing this out in https://github.com/cure53/DOMPurify/issues/1018#issue-2653000713.

I've also changed "require" to "default" so that it's the catch-all fallback.

Tasks

N/A

Dependencies

N/A

cure53 commented 1 week ago

Many thanks! :bow: