Download apps/vscode/src/utils/string.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 412 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vscode/src/utils/string.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/apps/vscode/src/utils/string.ts
-
curl -L -o string.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vscode/src/utils/string.ts
412 Bytes
| export function buildCaseInsensitiveGlobLiteral(input: string) { | |
| let out = ""; | |
| for (const ch of input) { | |
| if ((ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z")) { | |
| const l = ch.toLowerCase(); | |
| const u = ch.toUpperCase(); | |
| out += `[${l}${u}]`; | |
| } else { | |
| if ("*?[]{}\\".includes(ch)) { | |
| out += "\\" + ch; | |
| } else { | |
| out += ch; | |
| } | |
| } | |
| } | |
| return out; | |
| } | |