feat: add whole JSON size validation and check for storage usage

This commit is contained in:
lefuturiste 2020-07-29 20:12:23 +00:00
parent fefbf15f5e
commit 2b1e35e55f
5 changed files with 72 additions and 2 deletions

View file

@ -32,7 +32,7 @@ const email = {
lowercase: true,
unique: true,
validate: {
validator: function(v) {
validator: function(v: string) {
return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(v);
},
message: "Invalid email"