From 0d1ec66d5153688cfada9bd40eb76896aa79a3e0 Mon Sep 17 00:00:00 2001 From: Richard Korinek Date: Thu, 6 Oct 2022 17:09:12 +0200 Subject: [PATCH] Improved plain object checking --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 368070f611..e075f9e2ab 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -132,7 +132,7 @@ const isPlainObject = (val) => { } const prototype = getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); } /**