-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a76f6fd
commit fe229de
Showing
6 changed files
with
544 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* global ReadableStream, WritableStream, TransformStream */ | ||
module.exports = function () { | ||
return { | ||
buildSandboxGlobals(defaultGlobals) { | ||
return Object.assign({}, defaultGlobals, { | ||
fetch, | ||
AbortController, | ||
ReadableStream: | ||
typeof ReadableStream !== 'undefined' | ||
? ReadableStream | ||
: require('node:stream/web').ReadableStream, | ||
WritableStream: | ||
typeof WritableStream !== 'undefined' | ||
? WritableStream | ||
: require('node:stream/web').WritableStream, | ||
TransformStream: | ||
typeof TransformStream !== 'undefined' | ||
? TransformStream | ||
: require('node:stream/web').TransformStream, | ||
Headers: typeof Headers !== 'undefined' ? Headers : undefined, | ||
}); | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.