Use "self" instead of "window"
Could be possible to use self instead of window?
module.exports = self.FormData
I'm trying to instantiate Swagger in a webworker, and it is complaining because window doesn't exist.
There is been quite a motion around it, please check commit history :)
Maybe it’s time to create number of wrappers for different use cases. 🤔
cc @DylanPiercey
Sorry, I had in mind different file – https://github.com/form-data/form-data/commits/master/lib/browser.js
@DylanPiercey I think we can copy what we have there.
@alexindigo yeah that should work
@alexindigo given the goal of this module is to expose FormData globally, should we make a breaking change / major release and no longer export FormData? It seems like really the browser file for this module should just be empty, since presumably FormData is already global in the browser, even in a worker.
Alternatively, again since we are assuming there is already the global, could we not just change this to module.exports = FormData?
I'm also having the exact same issue, Can't use swagger-js in web worker because of this.

I'm also +1 to @DylanPiercey idea exporting directly module.exports = FormData rather than adding to the global window object.
What about using already standardized globalThis? I'll issue a PR if agreed that this is path forward.
I've issued a PR: https://github.com/form-data/isomorphic-form-data/pull/6 for using globalThis object. It's a breaking change but will work in all major browsers and latest node.js versions (and that's what we currently need).