Compare commits

...

2 Commits

@ -20,8 +20,11 @@ module.exports = function normalizeRules(rules, options) {
if (normalizeObjects) { if (normalizeObjects) {
// TODO: Switch to `Array#flatmap` once Node 10.x goes EOL (April 2021) // 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) => { 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 [ return [
isPlainObjectValidator, isPlainObjectValidator,
hasShape(rule) hasShape(rule)

@ -1,7 +1,7 @@
{ {
"name": "@validatem/normalize-rules", "name": "@validatem/normalize-rules",
"description": "Flattens and normalizes a list of rules, ready for pre-processing in a combinator", "description": "Flattens and normalizes a list of rules, ready for pre-processing in a combinator",
"version": "0.1.2", "version": "0.1.3",
"main": "index.js", "main": "index.js",
"repository": "http://git.cryto.net/validatem/normalize-rules.git", "repository": "http://git.cryto.net/validatem/normalize-rules.git",
"author": "Sven Slootweg <admin@cryto.net>", "author": "Sven Slootweg <admin@cryto.net>",

Loading…
Cancel
Save