Download webui/src/utils/maskSecret.js from a3216/ds2api: direct link, hf CLI and curl.
- Browser
- Download file 251 Bytes
-
https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/webui/src/utils/maskSecret.js
- Command line
-
hf download hf://spaces/a3216/ds2api@ce5a019598af8a3a8fa70d3880098df3e850ecd7/webui/src/utils/maskSecret.js
-
curl -L -o maskSecret.js https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/webui/src/utils/maskSecret.js
251 Bytes
| export function maskSecret(secret) { | |
| const value = String(secret ?? '') | |
| if (!value) { | |
| return '' | |
| } | |
| if (value.length <= 4) { | |
| return '*'.repeat(value.length) | |
| } | |
| return `${value.slice(0, 2)}****${value.slice(-2)}` | |
| } | |