Skip to content

Commit

Permalink
Fix Object.hasOwn is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
andylin9 committed Oct 28, 2024
1 parent 515bf19 commit 770b130
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 770b130

Please sign in to comment.