From 5e36f1de9ef7549f7e80b22f23485f7838ed02ea Mon Sep 17 00:00:00 2001 From: Dmitry <98899785+mdqst@users.noreply.github.com> Date: Sat, 16 Nov 2024 14:18:05 +0300 Subject: [PATCH] Fix Compatibility Issue with Object Property Check Update use-draw.ts This PR addresses a compatibility issue in the paths object by replacing the non-standard Object.hasOwn() method with the safer and more widely supported Object.prototype.hasOwnProperty.call(). This change ensures better cross-browser and cross-environment compatibility for property existence checks. --- apps/nextra/components/diagrams/use-draw.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nextra/components/diagrams/use-draw.ts b/apps/nextra/components/diagrams/use-draw.ts index 0fd6ba352..d48c7cd63 100644 --- a/apps/nextra/components/diagrams/use-draw.ts +++ b/apps/nextra/components/diagrams/use-draw.ts @@ -6,7 +6,7 @@ export function useDraw(paths = {}, name = "") { defaultLocale: string; }; - if (!Object.hasOwn(paths, defaultLocale)) { + if (!Object.prototype.hasOwnProperty.call(paths, defaultLocale)) { throw new Error( `Please provide '${defaultLocale}' locale inside '${paths}'.`, );