inibase 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -443,7 +443,9 @@ export default class Inibase {
|
|
|
443
443
|
data[field.key] = data[field.key].id;
|
|
444
444
|
if (field.regex) {
|
|
445
445
|
const regex = UtilsServer.getCachedRegex(field.regex);
|
|
446
|
-
if (
|
|
446
|
+
if ((Array.isArray(data[field.key]) &&
|
|
447
|
+
data[field.key].some((v) => !regex.test(String(v)))) ||
|
|
448
|
+
!regex.test(String(data[field.key])))
|
|
447
449
|
throw this.createError("INVALID_REGEX_MATCH", [field.key]);
|
|
448
450
|
}
|
|
449
451
|
if (field.unique) {
|