Skip to content

Commit 1d5cbf5

Browse files
committed
Refactor some more
1 parent 5445cbb commit 1d5cbf5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ import {unified} from 'unified'
9393
import {visit} from 'unist-util-visit'
9494
import {VFile} from 'vfile'
9595

96-
const own = {}.hasOwnProperty
9796
const changelog =
9897
'https://github.com/remarkjs/react-markdown/blob/main/changelog.md'
9998

@@ -251,7 +250,10 @@ export function Markdown(options) {
251250
let key
252251

253252
for (key in urlAttributes) {
254-
if (own.call(urlAttributes, key) && own.call(node.properties, key)) {
253+
if (
254+
Object.hasOwn(urlAttributes, key) &&
255+
Object.hasOwn(node.properties, key)
256+
) {
255257
const value = node.properties[key]
256258
const test = urlAttributes[key]
257259
if (test === null || test.includes(node.tagName)) {

0 commit comments

Comments
 (0)