fix: use modern in syntax instead of Object.prototype.hasOwnProperty

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-02-05 22:11:53 +01:00
parent ada2dce9c2
commit 5a7a37a241

View file

@ -18,7 +18,7 @@ export const OpengraphHead: React.FC = () => {
const elements = Object.entries(openGraphData)
.filter(([, value]) => value && String(value).trim() !== '')
.map(([key, value]) => <meta property={`og:${key}`} content={value} key={key} />)
if (!Object.prototype.hasOwnProperty.call(openGraphData, 'title')) {
if (!('title' in openGraphData)) {
elements.push(<meta property={'og:title'} content={noteTitle} />)
}
return elements