From 1d5cbf583f59cf6c48e971e12dccdb44c479754b Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 28 Sep 2023 09:23:50 +0200 Subject: [PATCH] Refactor some more --- lib/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index fa2336d..abe0ec2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -93,7 +93,6 @@ import {unified} from 'unified' import {visit} from 'unist-util-visit' import {VFile} from 'vfile' -const own = {}.hasOwnProperty const changelog = 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md' @@ -251,7 +250,10 @@ export function Markdown(options) { let key for (key in urlAttributes) { - if (own.call(urlAttributes, key) && own.call(node.properties, key)) { + if ( + Object.hasOwn(urlAttributes, key) && + Object.hasOwn(node.properties, key) + ) { const value = node.properties[key] const test = urlAttributes[key] if (test === null || test.includes(node.tagName)) {