Download spectrum/hyperion/renderer/browser-shim.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 466 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/hyperion/renderer/browser-shim.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/hyperion/renderer/browser-shim.js
-
curl -L -o browser-shim.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/hyperion/renderer/browser-shim.js
466 Bytes
| // @flow | |
| // Shim some browser stuff we use in the client for server-side rendering | |
| // NOTE(@mxstbr): We should be getting rid of this over time | |
| global.window = { | |
| location: { | |
| protocol: 'https:', | |
| host: 'spectrum.chat', | |
| hash: '', | |
| }, | |
| addEventListener: () => {}, | |
| }; | |
| global.localStorage = { | |
| getItem: () => null, | |
| setItem: () => {}, | |
| removeItem: () => {}, | |
| }; | |
| global.navigator = { | |
| userAgent: '', | |
| }; | |
| global.CSS = { | |
| escape: require('css.escape'), | |
| }; | |