From bb968847441312c4e0198a198420b4df365b3fa3 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Wed, 24 Jun 2020 04:11:49 +0200 Subject: [PATCH] Work around plain-object misdetection issue for now --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 59fe777..15a12d0 100644 --- a/index.js +++ b/index.js @@ -20,8 +20,11 @@ module.exports = function normalizeRules(rules, options) { if (normalizeObjects) { // TODO: Switch to `Array#flatmap` once Node 10.x goes EOL (April 2021) + // TODO: Better input validation of some sort here let mapped = actualRules.map((rule) => { - if (isPlainObj(rule) && !matchSpecial(rule)) { + // TODO: Figure out why isPlainObj in the below line breaks within a component in Shayu. Something something cross-realm objects something? + // if (isPlainObj(rule) && !matchSpecial(rule)) { + if (typeof rule === "object" && !matchSpecial(rule)) { return [ isPlainObjectValidator, hasShape(rule)