11 lines
246 B
TypeScript
11 lines
246 B
TypeScript
export const maskApiKey = (value: string): string => {
|
|
const trimmed = value.trim();
|
|
if (!trimmed) {
|
|
return "missing";
|
|
}
|
|
if (trimmed.length <= 16) {
|
|
return trimmed;
|
|
}
|
|
return `${trimmed.slice(0, 8)}...${trimmed.slice(-8)}`;
|
|
};
|