Spaces:
Paused
Paused
Download node_modules/msw/src/browser/utils/supportsReadableStreamTransfer.ts from sam522/GenAI_Course: direct link, hf CLI and curl.
- Browser
- Download file 438 Bytes
-
https://huggingface.co/spaces/sam522/GenAI_Course/resolve/bbf0eafbb40cb551e2f40f8ad8a90a585be08221/node_modules/msw/src/browser/utils/supportsReadableStreamTransfer.ts
- Command line
-
hf download hf://spaces/sam522/GenAI_Course@bbf0eafbb40cb551e2f40f8ad8a90a585be08221/node_modules/msw/src/browser/utils/supportsReadableStreamTransfer.ts
-
curl -L -o supportsReadableStreamTransfer.ts https://huggingface.co/spaces/sam522/GenAI_Course/resolve/bbf0eafbb40cb551e2f40f8ad8a90a585be08221/node_modules/msw/src/browser/utils/supportsReadableStreamTransfer.ts
438 Bytes
| /** | |
| * Returns a boolean indicating whether the current browser | |
| * supports `ReadableStream` as a `Transferable` when posting | |
| * messages. | |
| */ | |
| export function supportsReadableStreamTransfer() { | |
| try { | |
| const stream = new ReadableStream({ | |
| start: (controller) => controller.close(), | |
| }) | |
| const message = new MessageChannel() | |
| message.port1.postMessage(stream, [stream]) | |
| return true | |
| } catch { | |
| return false | |
| } | |
| } | |