Download src/lib/utils/json.ts from huggingface/inference-playground: direct link, hf CLI and curl.
- Browser
- Download file 105 Bytes
-
https://huggingface.co/spaces/huggingface/inference-playground/resolve/refs%2Fpr%2F13/src/lib/utils/json.ts
- Command line
-
hf download hf://spaces/huggingface/inference-playground@refs/pr/13/src/lib/utils/json.ts
-
curl -L -o json.ts https://huggingface.co/spaces/huggingface/inference-playground/resolve/refs%2Fpr%2F13/src/lib/utils/json.ts
105 Bytes
| export function safeParse(str: string) { | |
| try { | |
| return JSON.parse(str); | |
| } catch { | |
| return null; | |
| } | |
| } | |