I have a function template like this:
function (..., args: any) {...}
And I have a class called CreateLobbyParameter :
export class CreateLobbyParameter {
userId: number;
gameMode: GameMode;
}
If given any typed args parameter is not similar to CreateLobbyParameter (e.g. {userId: 0, gameMode: 0}, but not {userId:0}); I wanna handle that situation.
I've tried typeof(arg as CreateLobbyParameter), but it returns the string "object" for the parameter {userId: 0, gameMode: 0}, and not CreateLobbyParameter.
Also, arg instanceof CreateLobbyParameter returns false.
anyas an argument?GameModean enumeration or another class?argsinstead of typing it asany.