Skip to content

Commit 39f537c

Browse files
committed
🔧 fix bug in logger function
1 parent c610c74 commit 39f537c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/util/anonymize-key.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
const ANONYMIZED_KEY_LENGTH: number = 10;
22

3-
export function anonymizeKey(key: string): string {
3+
export function anonymizeKey(key: unknown): string {
4+
if (!key || typeof key !== "string") {
5+
return "UNKNOWN";
6+
}
7+
48
return `***${key.slice(key.length - ANONYMIZED_KEY_LENGTH)}`;
59
}

0 commit comments

Comments
 (0)