From b10d3059521f623f060a772491e152c4cfd83d51 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Fri, 23 Apr 2021 05:27:27 +0000 Subject: [PATCH] add 'blocking' prop to schema checks, allow a check in schema to skip the rest when it doesnt match expected value --- helpers/schema.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpers/schema.js b/helpers/schema.js index 7a5f6ff0..a9275144 100644 --- a/helpers/schema.js +++ b/helpers/schema.js @@ -61,6 +61,9 @@ module.exports = { const expected = (check.expected || false); if (result !== expected) { errors.push(check.error); + if (check.blocking === true) { + break; //errors that you want to stop and not bother checking the rest + } } } return errors;