fix: improve username transformation logic (#5115)

This commit is contained in:
Maxwell
2025-10-06 20:14:30 +10:00
committed by GitHub
parent dade3b4be6
commit b2a9e9a7dd

View File

@@ -15,7 +15,7 @@ export const getSchema = (normalizer: {
returned: true,
transform: {
input(value) {
return value == null
return typeof value !== "string"
? value
: normalizer.username(value as string);
},
@@ -26,7 +26,7 @@ export const getSchema = (normalizer: {
required: false,
transform: {
input(value) {
return value == null
return typeof value !== "string"
? value
: normalizer.displayUsername(value as string);
},