Spaces:
Running
Running
Download node_modules/@mswjs/interceptors/src/utils/canParseUrl.ts from fffiloni/live-vision: direct link, hf CLI and curl.
- Browser
- Download file 299 Bytes
-
https://huggingface.co/spaces/fffiloni/live-vision/resolve/main/node_modules/%40mswjs/interceptors/src/utils/canParseUrl.ts
- Command line
-
hf download hf://spaces/fffiloni/live-vision/node_modules/@mswjs/interceptors/src/utils/canParseUrl.ts
-
curl -L -o canParseUrl.ts https://huggingface.co/spaces/fffiloni/live-vision/resolve/main/node_modules/%40mswjs/interceptors/src/utils/canParseUrl.ts
299 Bytes
| /** | |
| * Returns a boolean indicating whether the given URL string | |
| * can be parsed into a `URL` instance. | |
| * A substitute for `URL.canParse()` for Node.js 18. | |
| */ | |
| export function canParseUrl(url: string): boolean { | |
| try { | |
| new URL(url) | |
| return true | |
| } catch (_error) { | |
| return false | |
| } | |
| } | |