We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c610c74 commit 39f537cCopy full SHA for 39f537c
src/util/anonymize-key.ts
@@ -1,5 +1,9 @@
1
const ANONYMIZED_KEY_LENGTH: number = 10;
2
3
-export function anonymizeKey(key: string): string {
+export function anonymizeKey(key: unknown): string {
4
+ if (!key || typeof key !== "string") {
5
+ return "UNKNOWN";
6
+ }
7
+
8
return `***${key.slice(key.length - ANONYMIZED_KEY_LENGTH)}`;
9
}
0 commit comments