4irbnb

Replicating airbnb following the atomic design principles...

View the Project on GitHub kokiebisu/4irbnb

Home > @nextbnb/common > isStay

isStay() function

Checks whether a given value is an IStay

Signature:

export declare function isStay(arg: any): arg is IStay;

Parameters

Parameter Type Description
arg any Value to be evaluated

Returns:

arg is IStay

Remarks

Id may switch to a string later on

Example

Here’s an example of how to use this guard

const stay = { id: '1', title: 'Cozy fireplace condo', imgUrl: ['www.imgUrl.com/1', ['www.imgUrl.com/2']] }
isStay(stay); // true