Last active
June 1, 2017 11:27
-
-
Save choonkending/050de8a5fd3bf349120db80e4f714cb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getFeatures = data => { | |
if (data && data.listing && data.listing.features) { | |
const { bedrooms, bathrooms } = data.listing.features; | |
const beds = bedrooms && bedrooms.value || 0; | |
const baths = bathrooms && bathrooms.value || 0; | |
if (beds === 0 && baths === 0) return null; | |
return { | |
bedrooms: beds, | |
bathrooms: baths | |
}; | |
} | |
return null; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment