Spaces:
Paused
Paused
Download src/utils/templateParser.js from Archy-Welcomer/welcomer: direct link, hf CLI and curl.
- Browser
- Download file 271 Bytes
-
https://huggingface.co/spaces/Archy-Welcomer/welcomer/resolve/main/src/utils/templateParser.js
- Command line
-
hf download hf://spaces/Archy-Welcomer/welcomer/src/utils/templateParser.js
-
curl -L -o templateParser.js https://huggingface.co/spaces/Archy-Welcomer/welcomer/resolve/main/src/utils/templateParser.js
271 Bytes
| export function parseTemplate(template, variables) { | |
| if (!template) return ''; | |
| return template | |
| .replace(/{username}/g, variables.username ?? '') | |
| .replace(/{server}/g, variables.server ?? '') | |
| .replace(/{memberCount}/g, variables.memberCount ?? ''); | |
| } |