Always pollutes global window object?
- Dominant language
- JavaScript
- Stars
- 12
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
This module seems pretty nice and simple. I see that you set `window.obind` value directly when in browser context, always polluting the global namespace. Would you be open to changing the
```
if (typeof module === 'object') {
module.exports = obind
}
if (typeof window === 'object') {
window.obind = obind
}
```
to an `else if` so that global pollution would be skipped when we're in a CommonJS environment (such as webpack bundling phase)? We could also go full on and use UMD. What do you think?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the module's export logic around module.exports and window.obind. Compare the proposed else-if behavior with the UMD alternative and determine which packaging behavior is intended; done means an agreed export strategy that avoids unwanted global pollution in CommonJS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100