(query: string)
| 1100 | * (`入口`, `로그인`), deduped, at most 16. |
| 1101 | */ |
| 1102 | export function exploreQueryTokens(query: string): string[] { |
| 1103 | const FILE_EXT = /\.(?:java|kt|kts|ts|tsx|js|jsx|mjs|cjs|cs|py|go|rb|php|swift|rs|cpp|cc|cxx|c|h|hpp|scala|lua|dart|vue|svelte|astro|erl|hrl)$/i; |
| 1104 | return [...new Set( |
| 1105 | query.split(/[\s,()[\]]+/) |
| 1106 | .map((t) => t.replace(FILE_EXT, '').trim()) |
| 1107 | .flatMap(splitAtCjkSwitches) |
| 1108 | .filter(isQueryNameToken) |
| 1109 | )].slice(0, 16); |
| 1110 | } |
| 1111 | |
| 1112 | /** |
| 1113 | * A query token written the way code names things — `ChangelogParser`, |
no test coverage detected