Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getPreview = text => {
LinkPreview.getPreview(text)
.then(data => {
this.setState({
isUri: true,
linkTitle: data.title ? data.title : undefined,
linkDesc: data.description ? data.description : undefined,
linkImg:
data.images && data.images.length > 0
? data.images.find(function(element) {
return (
element.includes(".png") ||
element.includes(".jpg") ||
element.includes(".jpeg")
);
})
: undefined,
linkFavicon: