Download src/lib/tools.js from timigogo/api: direct link, hf CLI and curl.
- Browser
- Download file 244 Bytes
-
https://huggingface.co/spaces/timigogo/api/resolve/main/src/lib/tools.js
- Command line
-
hf download hf://spaces/timigogo/api/src/lib/tools.js
-
curl -L -o tools.js https://huggingface.co/spaces/timigogo/api/resolve/main/src/lib/tools.js
244 Bytes
| const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)) | |
| function isJsonString(str) { | |
| try { | |
| JSON.parse(str) | |
| return true | |
| } catch (e) { | |
| return false | |
| } | |
| } | |
| module.exports = { | |
| sleep, | |
| isJsonString | |
| } |