Work around plain-object misdetection issue for now

This commit is contained in:
Sven Slootweg 2020-06-24 04:11:49 +02:00
parent 58b662c5cb
commit bb96884744

View file

@ -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)