inibase 1.4.0 → 1.4.1

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -1
  2. 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 (!regex.test(data[field.key]))
446
+ if ((Array.isArray(data[field.key]) &&
447
+ !data[field.key].every((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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inibase",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Karim Amahtil",