-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
When the library is used in a web worker there is an issue with undefined window so i suggest adding Web Workers detection such as :
// Environment detection
if (typeof module === "object" && module && typeof module.exports === "object") {
// Node.js
module.exports = msgpack;
}
else if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
// Global object
self[self.msgpackJsName || "msgpack"] = msgpack;
} else {
// Global object
window[window.msgpackJsName || "msgpack"] = msgpack;
}
Metadata
Metadata
Assignees
Labels
No labels