From b67d7149fe3e450ba2c3d190ab689a9067abeed2 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 27 Sep 2023 17:38:47 +0200 Subject: [PATCH] Change to require Node.js 16 --- lib/index.js | 3 +-- readme.md | 10 +++++----- tsconfig.json | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/index.js b/lib/index.js index 335d8493..0bf98706 100644 --- a/lib/index.js +++ b/lib/index.js @@ -187,8 +187,7 @@ export function Markdown(options) { } for (const deprecation of deprecations) { - // To do: use `Object.hasOwn`. - if (own.call(options, deprecation.from)) { + if (Object.hasOwn(options, deprecation.from)) { unreachable( 'Unexpected `' + deprecation.from + diff --git a/readme.md b/readme.md index 42485968..6b5b2470 100644 --- a/readme.md +++ b/readme.md @@ -200,7 +200,7 @@ Safe URL (`string`). Filter elements (TypeScript type). -###### Fields +###### Parameters * `node` ([`Element` from `hast`][hast-element]) — element to check @@ -284,7 +284,7 @@ Configuration (TypeScript type). Transform URLs (TypeScript type). -###### Fields +###### Parameters * `url` (`string`) — URL @@ -554,8 +554,8 @@ versions of Node.js. When we cut a new major release, we drop support for unmaintained versions of Node. -This means we try to keep the current release line, `react-markdown@^8`, -compatible with Node.js 12. +This means we try to keep the current release line, `react-markdown@^9`, +compatible with Node.js 16. They work in all modern browsers (essentially: everything not IE 11). You can use a bundler (such as esbuild, webpack, or Rollup) to use this package @@ -690,7 +690,7 @@ It lets you define your own schema of what is and isn’t allowed. * [`remark-gfm`][remark-gfm] — add support for GitHub flavored markdown support * [`react-remark`][react-remark] - — modern hook based alternative + — hook based alternative * [`rehype-react`][rehype-react] — turn HTML into React elements diff --git a/tsconfig.json b/tsconfig.json index 06e5468a..0fe0d02d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "lib": ["dom", "es2022"], "module": "node16", "strict": true, - "target": "es2020" + "target": "es2022" }, "exclude": ["coverage/", "node_modules/"], "include": ["**/*.js", "**/*.jsx", "lib/complex-types.d.ts"]