Replicating airbnb following the atomic design principles...
Home > @nextbnb/common > isStay
Checks whether a given value is an IStay
Signature:
export declare function isStay(arg: any): arg is IStay;
Parameter | Type | Description |
---|---|---|
arg | any | Value to be evaluated |
Returns:
arg is IStay
Id may switch to a string later on
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