4irbnb

Replicating airbnb following the atomic design principles...

View the Project on GitHub kokiebisu/4irbnb

Home > @nextbnb/common > isUser

isUser() function

Checks whether a given value is an IUser

Signature:

export declare function isUser(arg: any): arg is IUser;

Parameters

Parameter Type Description
arg any Value to be evaluated

Returns:

arg is IUser

Example

Here’s an example of how to use this guard

const user = { id: '1', username: 'john', name: 'John Parker', iconUrl: 'www.iconUrl.com' }
isUser(user); // true