From 770b13087ad3e7a78eaf545e81abb62aa76d5d38 Mon Sep 17 00:00:00 2001 From: andylin9 <108387233+andylin9@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:27:15 +0800 Subject: [PATCH] Fix Object.hasOwn is not a function --- lib/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/index.js b/lib/index.js index 6470cb8..9045ea5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -162,6 +162,11 @@ export function Markdown(options) { const file = new VFile() + if (!Object.hasOwn) { + Object.hasOwn = (obj, prop) => + Object.prototype.hasOwnProperty.call(obj, prop); + } + if (typeof children === 'string') { file.value = children } else {