Comparing version 0.7.4 to 0.7.5
@@ -91,5 +91,8 @@ "use strict"; | ||
} | ||
if (schema.regex != null && new RegExp(schema.regex, (_a = schema.regexFlags) !== null && _a !== void 0 ? _a : '').test(str)) { | ||
this.errors.push({ path, message: `must be in allowed format` }); | ||
valid = false; | ||
if (schema.regex != null) { | ||
const regex = new RegExp(schema.regex, (_a = schema.regexFlags) !== null && _a !== void 0 ? _a : ''); | ||
if (!regex.test(str)) { | ||
this.errors.push({ path, message: `must be in allowed format` }); | ||
valid = false; | ||
} | ||
} | ||
@@ -96,0 +99,0 @@ return valid ? str : this.defaultValue(schema); |
{ | ||
"name": "airtight", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "Tight subset of JSON schema", | ||
@@ -5,0 +5,0 @@ "main": "out/main/index.js", |
16585
443