Sign up and Working username display
This commit is contained in:
+10
-6
@@ -2,10 +2,14 @@ export type StringMap<T> = {
|
||||
[key: string]: T;
|
||||
};
|
||||
|
||||
export type NumberMap<T> = {
|
||||
[key: number]: T;
|
||||
};
|
||||
|
||||
export function narrow<T>(s: T, defd: T, ...allowed: T[]): T {
|
||||
if (allowed.includes(s) || s == defd) {
|
||||
return s;
|
||||
} else {
|
||||
return defd;
|
||||
}
|
||||
}
|
||||
if (allowed.includes(s) || s == defd) {
|
||||
return s;
|
||||
} else {
|
||||
return defd;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user