mirror of
https://github.com/langgenius/dify.git
synced 2026-11-13 14:51:39 +08:00
6 lines
228 B
TypeScript
6 lines
228 B
TypeScript
export function maskApiKey(token: string) {
|
|
// Knowledge API list responses are already masked by the server.
|
|
if (token.includes('...') || token === '***') return token
|
|
return `${token.slice(0, 5)}...${token.slice(-4)}`
|
|
}
|