function getLink(data: { [key: string]: any }) {
// Only checks if the key is in the object
if ('link' in data) {
return data['link']
}
else return 'https://default.com'
}
console.log(getLink({}))
console.log(getLink({ link: 'https://google.com' }))
// Produces null or undefined
console.log(getLink({ link: null }))