Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fastest-validator

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastest-validator - npm Package Compare versions

Comparing version 1.15.0 to 1.16.0

8

dist/index.js

@@ -202,2 +202,9 @@ (function (global, factory) {

var sanitized = false;
if (schema.convert === true) {
sanitized = true;
// Convert to array if not and the value is not null or undefined
src.push("\n\t\t\tif (!Array.isArray(value) && value != null) {\n\t\t\t\tvalue = [value];\n\t\t\t}\n\t\t");
}
src.push(("\n\t\tif (!Array.isArray(value)) {\n\t\t\t" + (this.makeError({ type: "array", actual: "value", messages: messages })) + "\n\t\t\treturn value;\n\t\t}\n\n\t\tvar len = value.length;\n\t"));

@@ -249,2 +256,3 @@

return {
sanitized: sanitized,
source: src.join("\n")

@@ -251,0 +259,0 @@ };

82

dist/index.min.js

@@ -14,13 +14,13 @@ 'use strict';var g=g||{};g.scope={};g.arrayIteratorImpl=function(f){var h=0;return function(){return h<f.length?{done:!1,value:f[h++]}:{done:!0}}};g.arrayIterator=function(f){return{next:g.arrayIteratorImpl(f)}};g.ASSUME_ES5=!1;g.ASSUME_NO_NATIVE_MAP=!1;g.ASSUME_NO_NATIVE_SET=!1;g.SIMPLE_FROUND_POLYFILL=!1;g.ISOLATE_POLYFILLS=!1;g.FORCE_POLYFILL_PROMISE=!1;g.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;

g.ES6_CONFORMANCE=g.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&g.checkEs6ConformanceViaProxy();g.makeIterator=function(f){var h="undefined"!=typeof Symbol&&Symbol.iterator&&f[Symbol.iterator];return h?h.call(f):g.arrayIterator(f)};
g.polyfill("WeakMap",function(f){function h(k){this.id_=(n+=Math.random()+1).toString();if(k){k=g.makeIterator(k);for(var p;!(p=k.next()).done;)p=p.value,this.set(p[0],p[1])}}function l(){if(!f||!Object.seal)return!1;try{var k=Object.seal({}),p=Object.seal({}),u=new f([[k,2],[p,3]]);if(2!=u.get(k)||3!=u.get(p))return!1;u.delete(k);u.set(p,4);return!u.has(k)&&4==u.get(p)}catch(C){return!1}}function m(){}function t(k){var p=typeof k;return"object"===p&&null!==k||"function"===p}function w(k){if(!g.owns(k,
y)){var p=new m;g.defineProperty(k,y,{value:p})}}function x(k){if(!g.ISOLATE_POLYFILLS){var p=Object[k];p&&(Object[k]=function(u){if(u instanceof m)return u;Object.isExtensible(u)&&w(u);return p(u)})}}if(g.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(f&&g.ES6_CONFORMANCE)return f}else if(l())return f;var y="$jscomp_hidden_"+Math.random();x("freeze");x("preventExtensions");x("seal");var n=0;h.prototype.set=function(k,p){if(!t(k))throw Error("Invalid WeakMap key");w(k);if(!g.owns(k,y))throw Error("WeakMap key fail: "+
k);k[y][this.id_]=p;return this};h.prototype.get=function(k){return t(k)&&g.owns(k,y)?k[y][this.id_]:void 0};h.prototype.has=function(k){return t(k)&&g.owns(k,y)&&g.owns(k[y],this.id_)};h.prototype.delete=function(k){return t(k)&&g.owns(k,y)&&g.owns(k[y],this.id_)?delete k[y][this.id_]:!1};return h},"es6","es3");g.MapEntry=function(){};
g.polyfill("Map",function(f){function h(){var n={};return n.previous=n.next=n.head=n}function l(n,k){var p=n.head_;return g.iteratorPrototype(function(){if(p){for(;p.head!=n.head_;)p=p.previous;for(;p.next!=p.head;)return p=p.next,{done:!1,value:k(p)};p=null}return{done:!0,value:void 0}})}function m(n,k){var p=k&&typeof k;"object"==p||"function"==p?x.has(k)?p=x.get(k):(p=""+ ++y,x.set(k,p)):p="p_"+k;var u=n.data_[p];if(u&&g.owns(n.data_,p))for(n=0;n<u.length;n++){var C=u[n];if(k!==k&&C.key!==C.key||
k===C.key)return{id:p,list:u,index:n,entry:C}}return{id:p,list:u,index:-1,entry:void 0}}function t(n){this.data_={};this.head_=h();this.size=0;if(n){n=g.makeIterator(n);for(var k;!(k=n.next()).done;)k=k.value,this.set(k[0],k[1])}}function w(){if(g.ASSUME_NO_NATIVE_MAP||!f||"function"!=typeof f||!f.prototype.entries||"function"!=typeof Object.seal)return!1;try{var n=Object.seal({x:4}),k=new f(g.makeIterator([[n,"s"]]));if("s"!=k.get(n)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;
var p=k.entries(),u=p.next();if(u.done||u.value[0]!=n||"s"!=u.value[1])return!1;u=p.next();return u.done||4!=u.value[0].x||"t"!=u.value[1]||!p.next().done?!1:!0}catch(C){return!1}}if(g.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(f&&g.ES6_CONFORMANCE)return f}else if(w())return f;var x=new WeakMap;t.prototype.set=function(n,k){n=0===n?0:n;var p=m(this,n);p.list||(p.list=this.data_[p.id]=[]);p.entry?p.entry.value=k:(p.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:n,value:k},p.list.push(p.entry),
this.head_.previous.next=p.entry,this.head_.previous=p.entry,this.size++);return this};t.prototype.delete=function(n){n=m(this,n);return n.entry&&n.list?(n.list.splice(n.index,1),n.list.length||delete this.data_[n.id],n.entry.previous.next=n.entry.next,n.entry.next.previous=n.entry.previous,n.entry.head=null,this.size--,!0):!1};t.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=h();this.size=0};t.prototype.has=function(n){return!!m(this,n).entry};t.prototype.get=function(n){return(n=
m(this,n).entry)&&n.value};t.prototype.entries=function(){return l(this,function(n){return[n.key,n.value]})};t.prototype.keys=function(){return l(this,function(n){return n.key})};t.prototype.values=function(){return l(this,function(n){return n.value})};t.prototype.forEach=function(n,k){for(var p=this.entries(),u;!(u=p.next()).done;)u=u.value,n.call(k,u[1],u[0],this)};t.prototype[Symbol.iterator]=t.prototype.entries;var y=0;return t},"es6","es3");
g.polyfill("WeakMap",function(f){function h(k){this.id_=(n+=Math.random()+1).toString();if(k){k=g.makeIterator(k);for(var q;!(q=k.next()).done;)q=q.value,this.set(q[0],q[1])}}function l(){if(!f||!Object.seal)return!1;try{var k=Object.seal({}),q=Object.seal({}),u=new f([[k,2],[q,3]]);if(2!=u.get(k)||3!=u.get(q))return!1;u.delete(k);u.set(q,4);return!u.has(k)&&4==u.get(q)}catch(C){return!1}}function m(){}function t(k){var q=typeof k;return"object"===q&&null!==k||"function"===q}function w(k){if(!g.owns(k,
y)){var q=new m;g.defineProperty(k,y,{value:q})}}function x(k){if(!g.ISOLATE_POLYFILLS){var q=Object[k];q&&(Object[k]=function(u){if(u instanceof m)return u;Object.isExtensible(u)&&w(u);return q(u)})}}if(g.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(f&&g.ES6_CONFORMANCE)return f}else if(l())return f;var y="$jscomp_hidden_"+Math.random();x("freeze");x("preventExtensions");x("seal");var n=0;h.prototype.set=function(k,q){if(!t(k))throw Error("Invalid WeakMap key");w(k);if(!g.owns(k,y))throw Error("WeakMap key fail: "+
k);k[y][this.id_]=q;return this};h.prototype.get=function(k){return t(k)&&g.owns(k,y)?k[y][this.id_]:void 0};h.prototype.has=function(k){return t(k)&&g.owns(k,y)&&g.owns(k[y],this.id_)};h.prototype.delete=function(k){return t(k)&&g.owns(k,y)&&g.owns(k[y],this.id_)?delete k[y][this.id_]:!1};return h},"es6","es3");g.MapEntry=function(){};
g.polyfill("Map",function(f){function h(){var n={};return n.previous=n.next=n.head=n}function l(n,k){var q=n.head_;return g.iteratorPrototype(function(){if(q){for(;q.head!=n.head_;)q=q.previous;for(;q.next!=q.head;)return q=q.next,{done:!1,value:k(q)};q=null}return{done:!0,value:void 0}})}function m(n,k){var q=k&&typeof k;"object"==q||"function"==q?x.has(k)?q=x.get(k):(q=""+ ++y,x.set(k,q)):q="p_"+k;var u=n.data_[q];if(u&&g.owns(n.data_,q))for(n=0;n<u.length;n++){var C=u[n];if(k!==k&&C.key!==C.key||
k===C.key)return{id:q,list:u,index:n,entry:C}}return{id:q,list:u,index:-1,entry:void 0}}function t(n){this.data_={};this.head_=h();this.size=0;if(n){n=g.makeIterator(n);for(var k;!(k=n.next()).done;)k=k.value,this.set(k[0],k[1])}}function w(){if(g.ASSUME_NO_NATIVE_MAP||!f||"function"!=typeof f||!f.prototype.entries||"function"!=typeof Object.seal)return!1;try{var n=Object.seal({x:4}),k=new f(g.makeIterator([[n,"s"]]));if("s"!=k.get(n)||1!=k.size||k.get({x:4})||k.set({x:4},"t")!=k||2!=k.size)return!1;
var q=k.entries(),u=q.next();if(u.done||u.value[0]!=n||"s"!=u.value[1])return!1;u=q.next();return u.done||4!=u.value[0].x||"t"!=u.value[1]||!q.next().done?!1:!0}catch(C){return!1}}if(g.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(f&&g.ES6_CONFORMANCE)return f}else if(w())return f;var x=new WeakMap;t.prototype.set=function(n,k){n=0===n?0:n;var q=m(this,n);q.list||(q.list=this.data_[q.id]=[]);q.entry?q.entry.value=k:(q.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:n,value:k},q.list.push(q.entry),
this.head_.previous.next=q.entry,this.head_.previous=q.entry,this.size++);return this};t.prototype.delete=function(n){n=m(this,n);return n.entry&&n.list?(n.list.splice(n.index,1),n.list.length||delete this.data_[n.id],n.entry.previous.next=n.entry.next,n.entry.next.previous=n.entry.previous,n.entry.head=null,this.size--,!0):!1};t.prototype.clear=function(){this.data_={};this.head_=this.head_.previous=h();this.size=0};t.prototype.has=function(n){return!!m(this,n).entry};t.prototype.get=function(n){return(n=
m(this,n).entry)&&n.value};t.prototype.entries=function(){return l(this,function(n){return[n.key,n.value]})};t.prototype.keys=function(){return l(this,function(n){return n.key})};t.prototype.values=function(){return l(this,function(n){return n.value})};t.prototype.forEach=function(n,k){for(var q=this.entries(),u;!(u=q.next()).done;)u=u.value,n.call(k,u[1],u[0],this)};t.prototype[Symbol.iterator]=t.prototype.entries;var y=0;return t},"es6","es3");
g.polyfill("String.prototype.endsWith",function(f){return f?f:function(h,l){var m=g.checkStringArgs(this,h,"endsWith");h+="";void 0===l&&(l=m.length);l=Math.max(0,Math.min(l|0,m.length));for(var t=h.length;0<t&&0<l;)if(m[--l]!=h[--t])return!1;return 0>=t}},"es6","es3");g.polyfill("Number.isNaN",function(f){return f?f:function(h){return"number"===typeof h&&isNaN(h)}},"es6","es3");
g.polyfill("Object.entries",function(f){return f?f:function(h){var l=[],m;for(m in h)g.owns(h,m)&&l.push([m,h[m]]);return l}},"es8","es3");var F=this;
function G(){function f(a){this.opts={};this.defaults={};this.messages=Object.assign({},q);this.rules={any:R,array:S,boolean:T,class:U,custom:V,currency:W,date:X,email:Y,enum:Z,equal:aa,forbidden:ba,function:ca,multi:C,number:u,object:p,objectID:k,record:n,string:y,tuple:x,url:w,uuid:t,mac:m,luhn:l};this.aliases={};this.cache=new Map;if(a){B(this.opts,a);a.defaults&&B(this.defaults,a.defaults);if(a.messages)for(var b in a.messages)this.addMessage(b,a.messages[b]);if(a.aliases)for(var c in a.aliases)this.alias(c,
function G(){function f(a){this.opts={};this.defaults={};this.messages=Object.assign({},r);this.rules={any:R,array:S,boolean:T,class:U,custom:V,currency:W,date:X,email:Y,enum:Z,equal:aa,forbidden:ba,function:ca,multi:C,number:u,object:q,objectID:k,record:n,string:y,tuple:x,url:w,uuid:t,mac:m,luhn:l};this.aliases={};this.cache=new Map;if(a){B(this.opts,a);a.defaults&&B(this.defaults,a.defaults);if(a.messages)for(var b in a.messages)this.addMessage(b,a.messages[b]);if(a.aliases)for(var c in a.aliases)this.alias(c,
a.aliases[c]);if(a.customRules)for(var d in a.customRules)this.add(d,a.customRules[d]);if(a.plugins){a=a.plugins;if(!Array.isArray(a))throw Error("Plugins type must be array");a.forEach(this.plugin.bind(this))}this.opts.debug&&(a=function(e){return e},"undefined"===typeof window&&(a=h),this._formatter=a)}}function h(a){H||(H=M(),N={parser:"babel",useTabs:!1,printWidth:120,trailingComma:"none",tabWidth:4,singleQuote:!1,semi:!0,bracketSpacing:!0},I=M(),O={language:"js",theme:I.fromJson({keyword:["white",

@@ -34,3 +34,3 @@ "bold"],built_in:"magenta",literal:"cyan",number:"magenta",regexp:"red",string:["yellow","bold"],symbol:"plain",class:"blue",attr:"plain",function:["white","bold"],title:"plain",params:"green",comment:"grey"})});a=H.format(a,N);return I.highlight(a,O)}function l(a){a.schema;a=a.messages;return{source:'\n\t\t\tif (typeof value !== "string") {\n\t\t\t\t'+this.makeError({type:"string",actual:"value",messages:a})+'\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (typeof value !== "string")\n\t\t\t\tvalue = String(value);\n\n\t\t\tval = value.replace(/\\D+/g, "");\n\n\t\t\tvar array = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9];\n\t\t\tvar len = val ? val.length : 0,\n\t\t\t\tbit = 1,\n\t\t\t\tsum = 0;\n\t\t\twhile (len--) {\n\t\t\t\tsum += !(bit ^= 1) ? parseInt(val[len], 10) : array[val[len]];\n\t\t\t}\n\n\t\t\tif (!(sum % 10 === 0 && sum > 0)) {\n\t\t\t\t'+

this.makeError({type:"tupleEmpty",actual:"value",messages:e})+"\n\t\t\t\treturn value;\n\t\t\t}\n\t\t");if(null!=d.items){a.push("\n\t\t\tif ("+d.empty+" !== false && len === 0) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (len !== "+d.items.length+") {\n\t\t\t\t"+this.makeError({type:"tupleLength",expected:d.items.length,actual:"len",messages:e})+"\n\t\t\t\treturn value;\n\t\t\t}\n\t\t");a.push("\n\t\t\tvar arr = value;\n\t\t\tvar parentField = field;\n\t\t");for(e=0;e<d.items.length;e++){a.push("\n\t\t\tvalue = arr["+
e+"];\n\t\t");var r=b+"["+e+"]",v=this.getRuleFromSchema(d.items[e]);a.push(this.compileRule(v,c,r,"\n\t\t\tarr["+e+"] = "+(c.async?"await ":"")+"context.fn[%%INDEX%%](arr["+e+'], (parentField ? parentField : "") + "[" + '+e+' + "]", parent, errors, context);\n\t\t',"arr["+e+"]"))}a.push("\n\t\treturn arr;\n\t")}else a.push("\n\t\treturn value;\n\t");return{source:a.join("\n")}}function y(a){var b=a.schema;a=a.messages;var c=[],d=!1;!0===b.convert&&(d=!0,c.push('\n\t\t\tif (typeof value !== "string") {\n\t\t\t\tvalue = String(value);\n\t\t\t}\n\t\t'));
e+"];\n\t\t");var p=b+"["+e+"]",v=this.getRuleFromSchema(d.items[e]);a.push(this.compileRule(v,c,p,"\n\t\t\tarr["+e+"] = "+(c.async?"await ":"")+"context.fn[%%INDEX%%](arr["+e+'], (parentField ? parentField : "") + "[" + '+e+' + "]", parent, errors, context);\n\t\t',"arr["+e+"]"))}a.push("\n\t\treturn arr;\n\t")}else a.push("\n\t\treturn value;\n\t");return{source:a.join("\n")}}function y(a){var b=a.schema;a=a.messages;var c=[],d=!1;!0===b.convert&&(d=!0,c.push('\n\t\t\tif (typeof value !== "string") {\n\t\t\t\tvalue = String(value);\n\t\t\t}\n\t\t'));
c.push('\n\t\tif (typeof value !== "string") {\n\t\t\t'+this.makeError({type:"string",actual:"value",messages:a})+"\n\t\t\treturn value;\n\t\t}\n\n\t\tvar origValue = value;\n\t");b.trim&&(d=!0,c.push("\n\t\t\tvalue = value.trim();\n\t\t"));b.trimLeft&&(d=!0,c.push("\n\t\t\tvalue = value.trimLeft();\n\t\t"));b.trimRight&&(d=!0,c.push("\n\t\t\tvalue = value.trimRight();\n\t\t"));b.padStart&&(d=!0,c.push("\n\t\t\tvalue = value.padStart("+b.padStart+", "+JSON.stringify(null!=b.padChar?b.padChar:" ")+

@@ -44,13 +44,13 @@ ");\n\t\t"));b.padEnd&&(d=!0,c.push("\n\t\t\tvalue = value.padEnd("+b.padEnd+", "+JSON.stringify(null!=b.padChar?b.padChar:" ")+");\n\t\t"));b.lowercase&&(d=!0,c.push("\n\t\t\tvalue = value.toLowerCase();\n\t\t"));b.uppercase&&(d=!0,c.push("\n\t\t\tvalue = value.toUpperCase();\n\t\t"));b.localeLowercase&&(d=!0,c.push("\n\t\t\tvalue = value.toLocaleLowerCase();\n\t\t"));b.localeUppercase&&(d=!0,c.push("\n\t\t\tvalue = value.toLocaleUpperCase();\n\t\t"));c.push("\n\t\t\tvar len = value.length;\n\t");

this.makeError({type:"stringBase64",actual:"origValue",messages:a})+"\n\t\t\t}\n\t\t");c.push("\n\t\treturn value;\n\t");return{sanitized:d,source:c.join("\n")}}function n(a,b,c){var d=a.schema,e=[];e.push('\n\t\tif (typeof value !== "object" || value === null || Array.isArray(value)) {\n\t\t\t'+this.makeError({type:"record",actual:"value",messages:a.messages})+"\n\t\t\treturn value;\n\t\t}\n\t");a=d.key||"string";d=d.value||"any";e.push("\n\t\tconst record = value;\n\t\tlet sanitizedKey, sanitizedValue;\n\t\tconst result = {};\n\t\tfor (let key in value) {\n\t");
e.push("sanitizedKey = value = key;");a=this.getRuleFromSchema(a);for(var r in a.messages)r.startsWith("string")&&(a.messages[r]=a.messages[r].replace(" field "," key "));e.push(this.compileRule(a,c,null,"\n\t\tsanitizedKey = "+(c.async?"await ":"")+'context.fn[%%INDEX%%](key, field ? field + "." + key : key, record, errors, context);\n\t',"sanitizedKey"));e.push("sanitizedValue = value = record[key];");r=this.getRuleFromSchema(d);e.push(this.compileRule(r,c,b+"[key]","\n\t\tsanitizedValue = "+(c.async?
e.push("sanitizedKey = value = key;");a=this.getRuleFromSchema(a);for(var p in a.messages)p.startsWith("string")&&(a.messages[p]=a.messages[p].replace(" field "," key "));e.push(this.compileRule(a,c,null,"\n\t\tsanitizedKey = "+(c.async?"await ":"")+'context.fn[%%INDEX%%](key, field ? field + "." + key : key, record, errors, context);\n\t',"sanitizedKey"));e.push("sanitizedValue = value = record[key];");p=this.getRuleFromSchema(d);e.push(this.compileRule(p,c,b+"[key]","\n\t\tsanitizedValue = "+(c.async?
"await ":"")+'context.fn[%%INDEX%%](value, field ? field + "." + key : key, record, errors, context);\n\t',"sanitizedValue"));e.push("result[sanitizedKey] = sanitizedValue;");e.push("\n\t\t}\n\t");e.push("return result;");return{source:e.join("\n")}}function k(a,b,c){b=a.schema;var d=a.messages;a=a.index;var e=[];c.customs[a]?c.customs[a].schema=b:c.customs[a]={schema:b};e.push("\n\t\tconst ObjectID = context.customs["+a+"].schema.ObjectID;\n\t\tif (!ObjectID.isValid(value)) {\n\t\t\t"+this.makeError({type:"objectID",
actual:"value",messages:d})+"\n\t\t\treturn;\n\t\t}\n\t");!0===b.convert?e.push("return new ObjectID(value)"):"hexString"===b.convert?e.push("return value.toString()"):e.push("return value");return{source:e.join("\n")}}function p(a,b,c){var d=a.schema;a=a.messages;var e=[];e.push('\n\t\tif (typeof value !== "object" || value === null || Array.isArray(value)) {\n\t\t\t'+this.makeError({type:"object",actual:"value",messages:a})+"\n\t\t\treturn value;\n\t\t}\n\t");var r=d.properties||d.props;if(r){e.push("var parentObj = value;");
e.push("var parentField = field;");for(var v=Object.keys(r),A=0;A<v.length;A++){var z=v[A],D=J(z),P=na.test(D)?"."+D:"['"+D+"']",K="parentObj"+P,Q=(b?b+".":"")+z,E=r[z].label;E=E?"'"+J(E)+"'":void 0;e.push("\n// Field: "+J(Q));e.push('field = parentField ? parentField + "'+P+'" : "'+D+'";');e.push("value = "+K+";");e.push("label = "+E);z=this.getRuleFromSchema(r[z]);e.push(this.compileRule(z,c,Q,"\n\t\t\t\t"+K+" = "+(c.async?"await ":"")+"context.fn[%%INDEX%%](value, field, parentObj, errors, context, label);\n\t\t\t",
K));!0===this.opts.haltOnFirstError&&e.push("if (errors.length) return parentObj;")}d.strict&&(b=Object.keys(r),e.push("\n\t\t\t\tfield = parentField;\n\t\t\t\tvar invalidProps = [];\n\t\t\t\tvar props = Object.keys(parentObj);\n\n\t\t\t\tfor (let i = 0; i < props.length; i++) {\n\t\t\t\t\tif ("+JSON.stringify(b)+".indexOf(props[i]) === -1) {\n\t\t\t\t\t\tinvalidProps.push(props[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (invalidProps.length) {\n\t\t\t"),"remove"===d.strict?(e.push("\n\t\t\t\t\tif (errors.length === 0) {\n\t\t\t\t"),
e.push("\n\t\t\t\t\t\tinvalidProps.forEach(function(field) {\n\t\t\t\t\t\t\tdelete parentObj[field];\n\t\t\t\t\t\t});\n\t\t\t\t"),e.push("\n\t\t\t\t\t}\n\t\t\t\t")):e.push("\n\t\t\t\t\t"+this.makeError({type:"objectStrict",expected:'"'+b.join(", ")+'"',actual:"invalidProps.join(', ')",messages:a})+"\n\t\t\t\t"),e.push("\n\t\t\t\t}\n\t\t\t"))}if(null!=d.minProps||null!=d.maxProps)d.strict?e.push("\n\t\t\t\tprops = Object.keys("+(r?"parentObj":"value")+");\n\t\t\t"):e.push("\n\t\t\t\tvar props = Object.keys("+
(r?"parentObj":"value")+");\n\t\t\t\t"+(r?"field = parentField;":"")+"\n\t\t\t");null!=d.minProps&&e.push("\n\t\t\tif (props.length < "+d.minProps+") {\n\t\t\t\t"+this.makeError({type:"objectMinProps",expected:d.minProps,actual:"props.length",messages:a})+"\n\t\t\t}\n\t\t");null!=d.maxProps&&e.push("\n\t\t\tif (props.length > "+d.maxProps+") {\n\t\t\t\t"+this.makeError({type:"objectMaxProps",expected:d.maxProps,actual:"props.length",messages:a})+"\n\t\t\t}\n\t\t");r?e.push("\n\t\t\treturn parentObj;\n\t\t"):
actual:"value",messages:d})+"\n\t\t\treturn;\n\t\t}\n\t");!0===b.convert?e.push("return new ObjectID(value)"):"hexString"===b.convert?e.push("return value.toString()"):e.push("return value");return{source:e.join("\n")}}function q(a,b,c){var d=a.schema;a=a.messages;var e=[];e.push('\n\t\tif (typeof value !== "object" || value === null || Array.isArray(value)) {\n\t\t\t'+this.makeError({type:"object",actual:"value",messages:a})+"\n\t\t\treturn value;\n\t\t}\n\t");var p=d.properties||d.props;if(p){e.push("var parentObj = value;");
e.push("var parentField = field;");for(var v=Object.keys(p),A=0;A<v.length;A++){var z=v[A],D=J(z),P=na.test(D)?"."+D:"['"+D+"']",K="parentObj"+P,Q=(b?b+".":"")+z,E=p[z].label;E=E?"'"+J(E)+"'":void 0;e.push("\n// Field: "+J(Q));e.push('field = parentField ? parentField + "'+P+'" : "'+D+'";');e.push("value = "+K+";");e.push("label = "+E);z=this.getRuleFromSchema(p[z]);e.push(this.compileRule(z,c,Q,"\n\t\t\t\t"+K+" = "+(c.async?"await ":"")+"context.fn[%%INDEX%%](value, field, parentObj, errors, context, label);\n\t\t\t",
K));!0===this.opts.haltOnFirstError&&e.push("if (errors.length) return parentObj;")}d.strict&&(b=Object.keys(p),e.push("\n\t\t\t\tfield = parentField;\n\t\t\t\tvar invalidProps = [];\n\t\t\t\tvar props = Object.keys(parentObj);\n\n\t\t\t\tfor (let i = 0; i < props.length; i++) {\n\t\t\t\t\tif ("+JSON.stringify(b)+".indexOf(props[i]) === -1) {\n\t\t\t\t\t\tinvalidProps.push(props[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (invalidProps.length) {\n\t\t\t"),"remove"===d.strict?(e.push("\n\t\t\t\t\tif (errors.length === 0) {\n\t\t\t\t"),
e.push("\n\t\t\t\t\t\tinvalidProps.forEach(function(field) {\n\t\t\t\t\t\t\tdelete parentObj[field];\n\t\t\t\t\t\t});\n\t\t\t\t"),e.push("\n\t\t\t\t\t}\n\t\t\t\t")):e.push("\n\t\t\t\t\t"+this.makeError({type:"objectStrict",expected:'"'+b.join(", ")+'"',actual:"invalidProps.join(', ')",messages:a})+"\n\t\t\t\t"),e.push("\n\t\t\t\t}\n\t\t\t"))}if(null!=d.minProps||null!=d.maxProps)d.strict?e.push("\n\t\t\t\tprops = Object.keys("+(p?"parentObj":"value")+");\n\t\t\t"):e.push("\n\t\t\t\tvar props = Object.keys("+
(p?"parentObj":"value")+");\n\t\t\t\t"+(p?"field = parentField;":"")+"\n\t\t\t");null!=d.minProps&&e.push("\n\t\t\tif (props.length < "+d.minProps+") {\n\t\t\t\t"+this.makeError({type:"objectMinProps",expected:d.minProps,actual:"props.length",messages:a})+"\n\t\t\t}\n\t\t");null!=d.maxProps&&e.push("\n\t\t\tif (props.length > "+d.maxProps+") {\n\t\t\t\t"+this.makeError({type:"objectMaxProps",expected:d.maxProps,actual:"props.length",messages:a})+"\n\t\t\t}\n\t\t");p?e.push("\n\t\t\treturn parentObj;\n\t\t"):
e.push("\n\t\t\treturn value;\n\t\t");return{source:e.join("\n")}}function u(a){var b=a.schema;a=a.messages;var c=[];c.push("\n\t\tvar origValue = value;\n\t");var d=!1;!0===b.convert&&(d=!0,c.push('\n\t\t\tif (typeof value !== "number") {\n\t\t\t\tvalue = Number(value);\n\t\t\t}\n\t\t'));c.push('\n\t\tif (typeof value !== "number" || isNaN(value) || !isFinite(value)) {\n\t\t\t'+this.makeError({type:"number",actual:"origValue",messages:a})+"\n\t\t\treturn value;\n\t\t}\n\t");null!=b.min&&c.push("\n\t\t\tif (value < "+
b.min+") {\n\t\t\t\t"+this.makeError({type:"numberMin",expected:b.min,actual:"origValue",messages:a})+"\n\t\t\t}\n\t\t");null!=b.max&&c.push("\n\t\t\tif (value > "+b.max+") {\n\t\t\t\t"+this.makeError({type:"numberMax",expected:b.max,actual:"origValue",messages:a})+"\n\t\t\t}\n\t\t");null!=b.equal&&c.push("\n\t\t\tif (value !== "+b.equal+") {\n\t\t\t\t"+this.makeError({type:"numberEqual",expected:b.equal,actual:"origValue",messages:a})+"\n\t\t\t}\n\t\t");null!=b.notEqual&&c.push("\n\t\t\tif (value === "+
b.notEqual+") {\n\t\t\t\t"+this.makeError({type:"numberNotEqual",expected:b.notEqual,actual:"origValue",messages:a})+"\n\t\t\t}\n\t\t");!0===b.integer&&c.push("\n\t\t\tif (value % 1 !== 0) {\n\t\t\t\t"+this.makeError({type:"numberInteger",actual:"origValue",messages:a})+"\n\t\t\t}\n\t\t");!0===b.positive&&c.push("\n\t\t\tif (value <= 0) {\n\t\t\t\t"+this.makeError({type:"numberPositive",actual:"origValue",messages:a})+"\n\t\t\t}\n\t\t");!0===b.negative&&c.push("\n\t\t\tif (value >= 0) {\n\t\t\t\t"+
this.makeError({type:"numberNegative",actual:"origValue",messages:a})+"\n\t\t\t}\n\t\t");c.push("\n\t\treturn value;\n\t");return{sanitized:d,source:c.join("\n")}}function C(a,b,c){var d=a.schema;a.messages;a=[];a.push("\n\t\tvar hasValid = false;\n\t\tvar newVal = value;\n\t\tvar checkErrors = [];\n\t\tvar errorsSize = errors.length;\n\t");for(var e=0;e<d.rules.length;e++){a.push("\n\t\t\tif (!hasValid) {\n\t\t\t\tvar _errors = [];\n\t\t");var r=this.getRuleFromSchema(d.rules[e]);a.push(this.compileRule(r,
this.makeError({type:"numberNegative",actual:"origValue",messages:a})+"\n\t\t\t}\n\t\t");c.push("\n\t\treturn value;\n\t");return{sanitized:d,source:c.join("\n")}}function C(a,b,c){var d=a.schema;a.messages;a=[];a.push("\n\t\tvar hasValid = false;\n\t\tvar newVal = value;\n\t\tvar checkErrors = [];\n\t\tvar errorsSize = errors.length;\n\t");for(var e=0;e<d.rules.length;e++){a.push("\n\t\t\tif (!hasValid) {\n\t\t\t\tvar _errors = [];\n\t\t");var p=this.getRuleFromSchema(d.rules[e]);a.push(this.compileRule(p,
c,b,"var tmpVal = "+(c.async?"await ":"")+"context.fn[%%INDEX%%](value, field, parent, _errors, context);","tmpVal"));a.push("\n\t\t\t\tif (errors.length == errorsSize && _errors.length == 0) {\n\t\t\t\t\thasValid = true;\n\t\t\t\t\tnewVal = tmpVal;\n\t\t\t\t} else {\n\t\t\t\t\tArray.prototype.push.apply(checkErrors, [].concat(_errors, errors.splice(errorsSize)));\n\t\t\t\t}\n\t\t\t}\n\t\t")}a.push("\n\t\tif (!hasValid) {\n\t\t\tArray.prototype.push.apply(errors, checkErrors);\n\t\t}\n\n\t\treturn newVal;\n\t");

@@ -63,12 +63,12 @@ return{source:a.join("\n")}}function ca(a){a.schema;return{source:'\n\t\t\tif (typeof value !== "function")\n\t\t\t\t'+this.makeError({type:"function",actual:"value",messages:a.messages})+"\n\n\t\t\treturn value;\n\t\t"}}function ba(a){var b=a.schema;a=a.messages;var c=[];c.push("\n\t\tif (value !== null && value !== undefined) {\n\t");b.remove?c.push("\n\t\t\treturn undefined;\n\t\t"):c.push("\n\t\t\t"+this.makeError({type:"forbidden",actual:"value",messages:a})+"\n\t\t");c.push("\n\t\t}\n\n\t\treturn value;\n\t");

source:c.join("\n")}}function X(a){var b=a.schema;a=a.messages;var c=[],d=!1;c.push("\n\t\tvar origValue = value;\n\t");!0===b.convert&&(d=!0,c.push("\n\t\t\tif (!(value instanceof Date)) {\n\t\t\t\tvalue = new Date(value.length && !isNaN(+value) ? +value : value);\n\t\t\t}\n\t\t"));c.push("\n\t\tif (!(value instanceof Date) || isNaN(value.getTime()))\n\t\t\t"+this.makeError({type:"date",actual:"origValue",messages:a})+"\n\n\t\treturn value;\n\t");return{sanitized:d,source:c.join("\n")}}function W(a){var b=
a.schema;a=a.messages;var c=b.currencySymbol||null,d=b.thousandSeparator||",",e=b.decimalSeparator||".",r=b.customRegex;b=!b.symbolOptional;b="(?=.*\\d)^(-?~1|~1-?)(([0-9]\\d{0,2}(~2\\d{3})*)|0)?(\\~3\\d{1,2})?$".replace(/~1/g,c?"\\"+c+(b?"":"?"):"").replace("~2",d).replace("~3",e);c=[];c.push("\n\t\tif (!value.match("+(r||new RegExp(b))+")) {\n\t\t\t"+this.makeError({type:"currency",actual:"value",messages:a})+"\n\t\t\treturn value;\n\t\t}\n\n\t\treturn value;\n\t");return{source:c.join("\n")}}function V(a,
b,c){var d=[];d.push("\n\t\t"+this.makeCustomValidator({fnName:"check",path:b,schema:a.schema,messages:a.messages,context:c,ruleIndex:a.index})+"\n\t\treturn value;\n\t");return{source:d.join("\n")}}function U(a,b,c){b=a.schema;var d=a.messages;a=a.index;var e=[],r=b.instanceOf.name?b.instanceOf.name:"<UnknowClass>";c.customs[a]?c.customs[a].schema=b:c.customs[a]={schema:b};e.push("\n\t\tif (!(value instanceof context.customs["+a+"].schema.instanceOf))\n\t\t\t"+this.makeError({type:"classInstanceOf",
actual:"value",expected:"'"+r+"'",messages:d})+"\n\t");e.push("\n\t\treturn value;\n\t");return{source:e.join("\n")}}function T(a){var b=a.schema;a=a.messages;var c=[],d=!1;c.push("\n\t\tvar origValue = value;\n\t");!0===b.convert&&(d=!0,c.push('\n\t\t\tif (typeof value !== "boolean") {\n\t\t\t\tif (\n\t\t\t\tvalue === 1\n\t\t\t\t|| value === "true"\n\t\t\t\t|| value === "1"\n\t\t\t\t|| value === "on"\n\t\t\t\t) {\n\t\t\t\t\tvalue = true;\n\t\t\t\t} else if (\n\t\t\t\tvalue === 0\n\t\t\t\t|| value === "false"\n\t\t\t\t|| value === "0"\n\t\t\t\t|| value === "off"\n\t\t\t\t) {\n\t\t\t\t\tvalue = false;\n\t\t\t\t}\n\t\t\t}\n\t\t'));
c.push('\n\t\tif (typeof value !== "boolean") {\n\t\t\t'+this.makeError({type:"boolean",actual:"origValue",messages:a})+"\n\t\t}\n\t\t\n\t\treturn value;\n\t");return{sanitized:d,source:c.join("\n")}}function S(a,b,c){var d=a.schema,e=a.messages;a=[];a.push("\n\t\tif (!Array.isArray(value)) {\n\t\t\t"+this.makeError({type:"array",actual:"value",messages:e})+"\n\t\t\treturn value;\n\t\t}\n\n\t\tvar len = value.length;\n\t");!1===d.empty&&a.push("\n\t\t\tif (len === 0) {\n\t\t\t\t"+this.makeError({type:"arrayEmpty",
actual:"value",messages:e})+"\n\t\t\t}\n\t\t");null!=d.min&&a.push("\n\t\t\tif (len < "+d.min+") {\n\t\t\t\t"+this.makeError({type:"arrayMin",expected:d.min,actual:"len",messages:e})+"\n\t\t\t}\n\t\t");null!=d.max&&a.push("\n\t\t\tif (len > "+d.max+") {\n\t\t\t\t"+this.makeError({type:"arrayMax",expected:d.max,actual:"len",messages:e})+"\n\t\t\t}\n\t\t");null!=d.length&&a.push("\n\t\t\tif (len !== "+d.length+") {\n\t\t\t\t"+this.makeError({type:"arrayLength",expected:d.length,actual:"len",messages:e})+
"\n\t\t\t}\n\t\t");null!=d.contains&&a.push("\n\t\t\tif (value.indexOf("+JSON.stringify(d.contains)+") === -1) {\n\t\t\t\t"+this.makeError({type:"arrayContains",expected:JSON.stringify(d.contains),actual:"value",messages:e})+"\n\t\t\t}\n\t\t");!0===d.unique&&a.push("\n\t\t\tif(len > (new Set(value)).size) {\n\t\t\t\t"+this.makeError({type:"arrayUnique",expected:"Array.from(new Set(value.filter((item, index) => value.indexOf(item) !== index)))",actual:"value",messages:e})+"\n\t\t\t}\n\t\t");if(null!=
d.enum){var r=JSON.stringify(d.enum);a.push("\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tif ("+r+".indexOf(value[i]) === -1) {\n\t\t\t\t\t"+this.makeError({type:"arrayEnum",expected:'"'+d.enum.join(", ")+'"',actual:"value[i]",messages:e})+"\n\t\t\t\t}\n\t\t\t}\n\t\t")}null!=d.items?(a.push("\n\t\t\tvar arr = value;\n\t\t\tvar parentField = field;\n\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\t\tvalue = arr[i];\n\t\t"),b+="[]",d=this.getRuleFromSchema(d.items),a.push(this.compileRule(d,
c,b,"arr[i] = "+(c.async?"await ":"")+'context.fn[%%INDEX%%](arr[i], (parentField ? parentField : "") + "[" + i + "]", parent, errors, context)',"arr[i]")),a.push("\n\t\t\t}\n\t\t"),a.push("\n\t\treturn arr;\n\t")):a.push("\n\t\treturn value;\n\t");return{source:a.join("\n")}}function R(){var a=[];a.push("\n\t\treturn value;\n\t");return{source:a.join("\n")}}function qa(a,b,c){return a.replace(b,void 0===c||null===c?"":"function"===typeof c.toString?c:typeof c)}function B(a,b,c){void 0===c&&(c={});
for(var d in b){var e=b[d];e="object"!==typeof e||Array.isArray(e)||null==e?!1:0<Object.keys(e).length;if(e)a[d]=a[d]||{},B(a[d],b[d],c);else if(!0!==c.skipIfExist||void 0===a[d])a[d]=b[d]}return a}function J(a){return a.replace(ra,function(b){switch(b){case '"':case "'":case "\\":return"\\"+b;case "\n":return"\\n";case "\r":return"\\r";case "\u2028":return"\\u2028";case "\u2029":return"\\u2029"}})}function M(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs");
}var q={required:"The '{field}' field is required.",string:"The '{field}' field must be a string.",stringEmpty:"The '{field}' field must not be empty.",stringMin:"The '{field}' field length must be greater than or equal to {expected} characters long.",stringMax:"The '{field}' field length must be less than or equal to {expected} characters long.",stringLength:"The '{field}' field length must be {expected} characters long.",stringPattern:"The '{field}' field fails to match the required pattern.",stringContains:"The '{field}' field must contain the '{expected}' text.",
a.schema;a=a.messages;var c=b.currencySymbol||null,d=b.thousandSeparator||",",e=b.decimalSeparator||".",p=b.customRegex;b=!b.symbolOptional;b="(?=.*\\d)^(-?~1|~1-?)(([0-9]\\d{0,2}(~2\\d{3})*)|0)?(\\~3\\d{1,2})?$".replace(/~1/g,c?"\\"+c+(b?"":"?"):"").replace("~2",d).replace("~3",e);c=[];c.push("\n\t\tif (!value.match("+(p||new RegExp(b))+")) {\n\t\t\t"+this.makeError({type:"currency",actual:"value",messages:a})+"\n\t\t\treturn value;\n\t\t}\n\n\t\treturn value;\n\t");return{source:c.join("\n")}}function V(a,
b,c){var d=[];d.push("\n\t\t"+this.makeCustomValidator({fnName:"check",path:b,schema:a.schema,messages:a.messages,context:c,ruleIndex:a.index})+"\n\t\treturn value;\n\t");return{source:d.join("\n")}}function U(a,b,c){b=a.schema;var d=a.messages;a=a.index;var e=[],p=b.instanceOf.name?b.instanceOf.name:"<UnknowClass>";c.customs[a]?c.customs[a].schema=b:c.customs[a]={schema:b};e.push("\n\t\tif (!(value instanceof context.customs["+a+"].schema.instanceOf))\n\t\t\t"+this.makeError({type:"classInstanceOf",
actual:"value",expected:"'"+p+"'",messages:d})+"\n\t");e.push("\n\t\treturn value;\n\t");return{source:e.join("\n")}}function T(a){var b=a.schema;a=a.messages;var c=[],d=!1;c.push("\n\t\tvar origValue = value;\n\t");!0===b.convert&&(d=!0,c.push('\n\t\t\tif (typeof value !== "boolean") {\n\t\t\t\tif (\n\t\t\t\tvalue === 1\n\t\t\t\t|| value === "true"\n\t\t\t\t|| value === "1"\n\t\t\t\t|| value === "on"\n\t\t\t\t) {\n\t\t\t\t\tvalue = true;\n\t\t\t\t} else if (\n\t\t\t\tvalue === 0\n\t\t\t\t|| value === "false"\n\t\t\t\t|| value === "0"\n\t\t\t\t|| value === "off"\n\t\t\t\t) {\n\t\t\t\t\tvalue = false;\n\t\t\t\t}\n\t\t\t}\n\t\t'));
c.push('\n\t\tif (typeof value !== "boolean") {\n\t\t\t'+this.makeError({type:"boolean",actual:"origValue",messages:a})+"\n\t\t}\n\t\t\n\t\treturn value;\n\t");return{sanitized:d,source:c.join("\n")}}function S(a,b,c){var d=a.schema,e=a.messages;a=[];var p=!1;!0===d.convert&&(p=!0,a.push("\n\t\t\tif (!Array.isArray(value) && value != null) {\n\t\t\t\tvalue = [value];\n\t\t\t}\n\t\t"));a.push("\n\t\tif (!Array.isArray(value)) {\n\t\t\t"+this.makeError({type:"array",actual:"value",messages:e})+"\n\t\t\treturn value;\n\t\t}\n\n\t\tvar len = value.length;\n\t");
!1===d.empty&&a.push("\n\t\t\tif (len === 0) {\n\t\t\t\t"+this.makeError({type:"arrayEmpty",actual:"value",messages:e})+"\n\t\t\t}\n\t\t");null!=d.min&&a.push("\n\t\t\tif (len < "+d.min+") {\n\t\t\t\t"+this.makeError({type:"arrayMin",expected:d.min,actual:"len",messages:e})+"\n\t\t\t}\n\t\t");null!=d.max&&a.push("\n\t\t\tif (len > "+d.max+") {\n\t\t\t\t"+this.makeError({type:"arrayMax",expected:d.max,actual:"len",messages:e})+"\n\t\t\t}\n\t\t");null!=d.length&&a.push("\n\t\t\tif (len !== "+d.length+
") {\n\t\t\t\t"+this.makeError({type:"arrayLength",expected:d.length,actual:"len",messages:e})+"\n\t\t\t}\n\t\t");null!=d.contains&&a.push("\n\t\t\tif (value.indexOf("+JSON.stringify(d.contains)+") === -1) {\n\t\t\t\t"+this.makeError({type:"arrayContains",expected:JSON.stringify(d.contains),actual:"value",messages:e})+"\n\t\t\t}\n\t\t");!0===d.unique&&a.push("\n\t\t\tif(len > (new Set(value)).size) {\n\t\t\t\t"+this.makeError({type:"arrayUnique",expected:"Array.from(new Set(value.filter((item, index) => value.indexOf(item) !== index)))",
actual:"value",messages:e})+"\n\t\t\t}\n\t\t");if(null!=d.enum){var v=JSON.stringify(d.enum);a.push("\n\t\t\tfor (var i = 0; i < value.length; i++) {\n\t\t\t\tif ("+v+".indexOf(value[i]) === -1) {\n\t\t\t\t\t"+this.makeError({type:"arrayEnum",expected:'"'+d.enum.join(", ")+'"',actual:"value[i]",messages:e})+"\n\t\t\t\t}\n\t\t\t}\n\t\t")}null!=d.items?(a.push("\n\t\t\tvar arr = value;\n\t\t\tvar parentField = field;\n\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\t\tvalue = arr[i];\n\t\t"),b+=
"[]",d=this.getRuleFromSchema(d.items),a.push(this.compileRule(d,c,b,"arr[i] = "+(c.async?"await ":"")+'context.fn[%%INDEX%%](arr[i], (parentField ? parentField : "") + "[" + i + "]", parent, errors, context)',"arr[i]")),a.push("\n\t\t\t}\n\t\t"),a.push("\n\t\treturn arr;\n\t")):a.push("\n\t\treturn value;\n\t");return{sanitized:p,source:a.join("\n")}}function R(){var a=[];a.push("\n\t\treturn value;\n\t");return{source:a.join("\n")}}function qa(a,b,c){return a.replace(b,void 0===c||null===c?"":"function"===
typeof c.toString?c:typeof c)}function B(a,b,c){void 0===c&&(c={});for(var d in b){var e=b[d];e="object"!==typeof e||Array.isArray(e)||null==e?!1:0<Object.keys(e).length;if(e)a[d]=a[d]||{},B(a[d],b[d],c);else if(!0!==c.skipIfExist||void 0===a[d])a[d]=b[d]}return a}function J(a){return a.replace(ra,function(b){switch(b){case '"':case "'":case "\\":return"\\"+b;case "\n":return"\\n";case "\r":return"\\r";case "\u2028":return"\\u2028";case "\u2029":return"\\u2029"}})}function M(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs");
}var r={required:"The '{field}' field is required.",string:"The '{field}' field must be a string.",stringEmpty:"The '{field}' field must not be empty.",stringMin:"The '{field}' field length must be greater than or equal to {expected} characters long.",stringMax:"The '{field}' field length must be less than or equal to {expected} characters long.",stringLength:"The '{field}' field length must be {expected} characters long.",stringPattern:"The '{field}' field fails to match the required pattern.",stringContains:"The '{field}' field must contain the '{expected}' text.",
stringEnum:"The '{field}' field does not match any of the allowed values.",stringNumeric:"The '{field}' field must be a numeric string.",stringAlpha:"The '{field}' field must be an alphabetic string.",stringAlphanum:"The '{field}' field must be an alphanumeric string.",stringAlphadash:"The '{field}' field must be an alphadash string.",stringHex:"The '{field}' field must be a hex string.",stringSingleLine:"The '{field}' field must be a single line string.",stringBase64:"The '{field}' field must be a base64 string.",

@@ -80,19 +80,19 @@ number:"The '{field}' field must be a number.",numberMin:"The '{field}' field must be greater than or equal to {expected}.",numberMax:"The '{field}' field must be less than or equal to {expected}.",numberEqual:"The '{field}' field must be equal to {expected}.",numberNotEqual:"The '{field}' field can't be equal to {expected}.",numberInteger:"The '{field}' field must be an integer.",numberPositive:"The '{field}' field must be a positive number.",numberNegative:"The '{field}' field must be a negative number.",

luhn:"The '{field}' field must be a valid checksum luhn.",mac:"The '{field}' field must be a valid MAC address.",object:"The '{field}' must be an Object.",objectStrict:"The object '{field}' contains forbidden keys: '{actual}'.",objectMinProps:"The object '{field}' must contain at least {expected} properties.",objectMaxProps:"The object '{field}' must contain {expected} properties at most.",url:"The '{field}' field must be a valid URL.",urlEmpty:"The '{field}' field must not be empty.",uuid:"The '{field}' field must be a valid UUID.",
uuidVersion:"The '{field}' field must be a valid UUID version provided.",classInstanceOf:"The '{field}' field must be an instance of the '{expected}' class.",objectID:"The '{field}' field must be an valid ObjectID",record:"The '{field}' must be an Object."};q.required;q.string;q.stringEmpty;q.stringMin;q.stringMax;q.stringLength;q.stringPattern;q.stringContains;q.stringEnum;q.stringNumeric;q.stringAlpha;q.stringAlphanum;q.stringAlphadash;q.stringHex;q.stringSingleLine;q.stringBase64;q.number;q.numberMin;
q.numberMax;q.numberEqual;q.numberNotEqual;q.numberInteger;q.numberPositive;q.numberNegative;q.array;q.arrayEmpty;q.arrayMin;q.arrayMax;q.arrayLength;q.arrayContains;q.arrayUnique;q.arrayEnum;q.tuple;q.tupleEmpty;q.tupleLength;q.currency;q.date;q.dateMin;q.dateMax;q.enumValue;q.equalValue;q.equalField;q.forbidden;q.email;q.emailEmpty;q.emailMin;q.emailMax;q.luhn;q.mac;q.object;q.objectStrict;q.objectMinProps;q.objectMaxProps;q.url;q.urlEmpty;q.uuid;q.uuidVersion;q.classInstanceOf;q.objectID;q.record;
uuidVersion:"The '{field}' field must be a valid UUID version provided.",classInstanceOf:"The '{field}' field must be an instance of the '{expected}' class.",objectID:"The '{field}' field must be an valid ObjectID",record:"The '{field}' must be an Object."};r.required;r.string;r.stringEmpty;r.stringMin;r.stringMax;r.stringLength;r.stringPattern;r.stringContains;r.stringEnum;r.stringNumeric;r.stringAlpha;r.stringAlphanum;r.stringAlphadash;r.stringHex;r.stringSingleLine;r.stringBase64;r.number;r.numberMin;
r.numberMax;r.numberEqual;r.numberNotEqual;r.numberInteger;r.numberPositive;r.numberNegative;r.array;r.arrayEmpty;r.arrayMin;r.arrayMax;r.arrayLength;r.arrayContains;r.arrayUnique;r.arrayEnum;r.tuple;r.tupleEmpty;r.tupleLength;r.currency;r.date;r.dateMin;r.dateMax;r.enumValue;r.equalValue;r.equalField;r.forbidden;r.email;r.emailEmpty;r.emailMin;r.emailMax;r.luhn;r.mac;r.object;r.objectStrict;r.objectMinProps;r.objectMaxProps;r.url;r.urlEmpty;r.uuid;r.uuidVersion;r.classInstanceOf;r.objectID;r.record;
var oa=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,pa=/^\S+@\S+\.\S+$/,na=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/,ra=/["'\\\n\r\u2028\u2029]/g,ha=/^-?[0-9]\d*(\.\d+)?$/,ia=/^[a-zA-Z]+$/,ja=/^[a-zA-Z0-9]+$/,ka=/^[a-zA-Z0-9_-]+$/,la=/^[0-9a-fA-F]+$/,ma=/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+/]{3}=)?$/,fa=/^https?:\/\/\S+/,ea=/^([0-9a-f]{8}-[0-9a-f]{4}-[1-6][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}|[0]{8}-[0]{4}-[0]{4}-[0]{4}-[0]{12})$/i,
da=/^((([a-f0-9][a-f0-9]+[-]){5}|([a-f0-9][a-f0-9]+[:]){5})([a-f0-9][a-f0-9])$)|(^([a-f0-9][a-f0-9][a-f0-9][a-f0-9]+[.]){2}([a-f0-9][a-f0-9][a-f0-9][a-f0-9]))$/i,H,N,I,O;try{var L=(new Function("return Object.getPrototypeOf(async function(){}).constructor"))()}catch(a){}f.prototype.validate=function(a,b){return this.compile(b)(a)};f.prototype.wrapRequiredCheckSourceCode=function(a,b,c,d){var e=[],r=!0===a.schema.optional||"forbidden"===a.schema.type,v=!0===a.schema.optional||!0===a.schema.nullable||
"forbidden"===a.schema.type;null!=a.schema.default?(r=!1,!0!==a.schema.nullable&&(v=!1),"function"===typeof a.schema.default?(c.customs[a.index]||(c.customs[a.index]={}),c.customs[a.index].defaultFn=a.schema.default,a="context.customs["+a.index+"].defaultFn.call(this, context.rules["+a.index+"].schema, field, parent, context)"):a=JSON.stringify(a.schema.default),d="\n\t\t\t\tvalue = "+a+";\n\t\t\t\t"+d+" = value;\n\t\t\t"):d=this.makeError({type:"required",actual:"value",messages:a.messages});e.push("\n\t\t\tif (value === undefined) { "+
((r?"\n// allow undefined\n":d)+" }\n\t\t\telse if (value === null) { ")+((v?"\n// allow null\n":d)+" }\n\t\t\t")+(b?"else { "+b+" }":"")+"\n\t\t");return e.join("\n")};f.prototype.compile=function(a){function b(v,A){d.data=v;A&&A.meta&&(d.meta=A.meta);return r.call(c,v,d)}if(null===a||"object"!==typeof a)throw Error("Invalid schema.");var c=this,d={index:0,async:!0===a.$$async,rules:[],fn:[],customs:{},utils:{replace:qa}};this.cache.clear();delete a.$$async;if(d.async&&!L)throw Error("Asynchronous mode is not supported.");
da=/^((([a-f0-9][a-f0-9]+[-]){5}|([a-f0-9][a-f0-9]+[:]){5})([a-f0-9][a-f0-9])$)|(^([a-f0-9][a-f0-9][a-f0-9][a-f0-9]+[.]){2}([a-f0-9][a-f0-9][a-f0-9][a-f0-9]))$/i,H,N,I,O;try{var L=(new Function("return Object.getPrototypeOf(async function(){}).constructor"))()}catch(a){}f.prototype.validate=function(a,b){return this.compile(b)(a)};f.prototype.wrapRequiredCheckSourceCode=function(a,b,c,d){var e=[],p=!0===a.schema.optional||"forbidden"===a.schema.type,v=!0===a.schema.optional||!0===a.schema.nullable||
"forbidden"===a.schema.type;null!=a.schema.default?(p=!1,!0!==a.schema.nullable&&(v=!1),"function"===typeof a.schema.default?(c.customs[a.index]||(c.customs[a.index]={}),c.customs[a.index].defaultFn=a.schema.default,a="context.customs["+a.index+"].defaultFn.call(this, context.rules["+a.index+"].schema, field, parent, context)"):a=JSON.stringify(a.schema.default),d="\n\t\t\t\tvalue = "+a+";\n\t\t\t\t"+d+" = value;\n\t\t\t"):d=this.makeError({type:"required",actual:"value",messages:a.messages});e.push("\n\t\t\tif (value === undefined) { "+
((p?"\n// allow undefined\n":d)+" }\n\t\t\telse if (value === null) { ")+((v?"\n// allow null\n":d)+" }\n\t\t\t")+(b?"else { "+b+" }":"")+"\n\t\t");return e.join("\n")};f.prototype.compile=function(a){function b(v,A){d.data=v;A&&A.meta&&(d.meta=A.meta);return p.call(c,v,d)}if(null===a||"object"!==typeof a)throw Error("Invalid schema.");var c=this,d={index:0,async:!0===a.$$async,rules:[],fn:[],customs:{},utils:{replace:qa}};this.cache.clear();delete a.$$async;if(d.async&&!L)throw Error("Asynchronous mode is not supported.");
if(!0!==a.$$root)if(Array.isArray(a))a=this.getRuleFromSchema(a).schema;else{var e=Object.assign({},a);a={type:"object",strict:e.$$strict,properties:e};delete e.$$strict}e=["var errors = [];","var field;","var parent = null;","var label = "+(a.label?'"'+a.label+'"':"null")+";"];a=this.getRuleFromSchema(a);e.push(this.compileRule(a,d,null,(d.async?"await ":"")+"context.fn[%%INDEX%%](value, field, null, errors, context, label);","value"));e.push("if (errors.length) {");e.push("\n\t\t\treturn errors.map(err => {\n\t\t\t\tif (err.message) {\n\t\t\t\t\terr.message = context.utils.replace(err.message, /\\{field\\}/g, err.label || err.field);\n\t\t\t\t\terr.message = context.utils.replace(err.message, /\\{expected\\}/g, err.expected);\n\t\t\t\t\terr.message = context.utils.replace(err.message, /\\{actual\\}/g, err.actual);\n\t\t\t\t}\n\t\t\t\tif(!err.label) delete err.label\n\t\t\t\treturn err;\n\t\t\t});\n\t\t");
e.push("}");e.push("return true;");a=e.join("\n");var r=new (d.async?L:Function)("value","context",a);this.opts.debug&&console.log(this._formatter("// Main check function\n"+r.toString()));this.cache.clear();b.async=d.async;return b};f.prototype.compileRule=function(a,b,c,d,e){var r=[],v=this.cache.get(a.schema);v?(a=v,a.cycle=!0,a.cycleStack=[],r.push(this.wrapRequiredCheckSourceCode(a,"\n\t\t\t\tvar rule = context.rules["+a.index+"];\n\t\t\t\tif (rule.cycleStack.indexOf(value) === -1) {\n\t\t\t\t\trule.cycleStack.push(value);\n\t\t\t\t\t"+
d.replace(/%%INDEX%%/g,a.index)+"\n\t\t\t\t\trule.cycleStack.pop(value);\n\t\t\t\t}\n\t\t\t",b,e))):(this.cache.set(a.schema,a),a.index=b.index,b.rules[b.index]=a,v=null!=c?c:"$$root",b.index++,c=a.ruleFunction.call(this,a,c,b),c.source=c.source.replace(/%%INDEX%%/g,a.index),c=new (b.async?L:Function)("value","field","parent","errors","context","label",c.source),b.fn[a.index]=c.bind(this),r.push(this.wrapRequiredCheckSourceCode(a,d.replace(/%%INDEX%%/g,a.index),b,e)),r.push(this.makeCustomValidator({vName:e,
path:v,schema:a.schema,context:b,messages:a.messages,ruleIndex:a.index})),this.opts.debug&&console.log(this._formatter("// Context.fn["+a.index+"]\n"+c.toString())));return r.join("\n")};f.prototype.getRuleFromSchema=function(a){a=this.resolveType(a);var b=this.aliases[a.type];b&&(delete a.type,a=B(a,b,{skipIfExist:!0}));b=this.rules[a.type];if(!b)throw Error("Invalid '"+a.type+"' type in validator schema.");return{messages:Object.assign({},this.messages,a.messages),schema:B(a,this.defaults[a.type],
{skipIfExist:!0}),ruleFunction:b}};f.prototype.parseShortHand=function(a){a=a.split("|").map(function(d){return d.trim()});var b=a[0];var c=b.endsWith("[]")?this.getRuleFromSchema({type:"array",items:b.slice(0,-2)}).schema:{type:a[0]};a.slice(1).map(function(d){var e=d.indexOf(":");if(-1!==e){var r=d.substr(0,e).trim();d=d.substr(e+1).trim();"true"===d||"false"===d?d="true"===d:Number.isNaN(Number(d))||(d=Number(d));c[r]=d}else d.startsWith("no-")?c[d.slice(3)]=!1:c[d]=!0});return c};f.prototype.makeError=
function(a){var b=a.type,c=a.field,d=a.expected,e=a.actual,r={type:'"'+b+'"',message:'"'+a.messages[b]+'"'};r.field=c?'"'+c+'"':"field";null!=d&&(r.expected=d);null!=e&&(r.actual=e);r.label="label";return"errors.push({ "+Object.keys(r).map(function(v){return v+": "+r[v]}).join(", ")+" });"};f.prototype.makeCustomValidator=function(a){var b=a.vName;void 0===b&&(b="value");var c=a.fnName;void 0===c&&(c="custom");var d=a.ruleIndex,e=a.path,r=a.schema,v=a.context,A=a.messages;a="rule"+d;var z="fnCustomErrors"+
d;if("function"==typeof r[c]){v.customs[d]?(v.customs[d].messages=A,v.customs[d].schema=r):v.customs[d]={messages:A,schema:r};if(this.opts.useNewCustomCheckerFunction)return"\n \t\tconst "+a+" = context.customs["+d+"];\n\t\t\t\t\tconst "+z+" = [];\n\t\t\t\t\t"+b+" = "+(v.async?"await ":"")+a+".schema."+c+".call(this, "+b+", "+z+" , "+a+'.schema, "'+e+'", parent, context);\n\t\t\t\t\tif (Array.isArray('+z+" )) {\n \t\t"+z+" .forEach(err => errors.push(Object.assign({ message: "+
a+".messages[err.type], field }, err)));\n\t\t\t\t\t}\n\t\t\t\t";r="res_"+a;return"\n\t\t\t\tconst "+a+" = context.customs["+d+"];\n\t\t\t\tconst "+r+" = "+(v.async?"await ":"")+a+".schema."+c+".call(this, "+b+", "+a+'.schema, "'+e+'", parent, context);\n\t\t\t\tif (Array.isArray('+r+")) {\n\t\t\t\t\t"+r+".forEach(err => errors.push(Object.assign({ message: "+a+".messages[err.type], field }, err)));\n\t\t\t\t}\n\t\t"}return""};f.prototype.add=function(a,b){this.rules[a]=b};f.prototype.addMessage=
function(a,b){this.messages[a]=b};f.prototype.alias=function(a,b){if(this.rules[a])throw Error("Alias name must not be a rule name");this.aliases[a]=b};f.prototype.plugin=function(a){if("function"!==typeof a)throw Error("Plugin fn type must be function");return a(this)};f.prototype.resolveType=function(a){var b=this;if("string"===typeof a)a=this.parseShortHand(a);else if(Array.isArray(a)){if(0===a.length)throw Error("Invalid schema.");a={type:"multi",rules:a};a.rules.map(function(r){return b.getRuleFromSchema(r)}).every(function(r){return!0===
r.schema.optional})&&(a.optional=!0);a.rules.map(function(r){return b.getRuleFromSchema(r)}).every(function(r){return!0===r.schema.nullable})&&(a.nullable=!0)}if(a.$$type){var c=this.getRuleFromSchema(a.$$type).schema;delete a.$$type;var d=Object.assign({},a),e;for(e in a)delete a[e];B(a,c,{skipIfExist:!0});a.props=d}return a};f.prototype.normalize=function(a){var b=this,c=this.resolveType(a);this.aliases[c.type]&&(c=B(c,this.normalize(this.aliases[c.type]),{skipIfExists:!0}));c=B(c,this.defaults[c.type],
e.push("}");e.push("return true;");a=e.join("\n");var p=new (d.async?L:Function)("value","context",a);this.opts.debug&&console.log(this._formatter("// Main check function\n"+p.toString()));this.cache.clear();b.async=d.async;return b};f.prototype.compileRule=function(a,b,c,d,e){var p=[],v=this.cache.get(a.schema);v?(a=v,a.cycle=!0,a.cycleStack=[],p.push(this.wrapRequiredCheckSourceCode(a,"\n\t\t\t\tvar rule = context.rules["+a.index+"];\n\t\t\t\tif (rule.cycleStack.indexOf(value) === -1) {\n\t\t\t\t\trule.cycleStack.push(value);\n\t\t\t\t\t"+
d.replace(/%%INDEX%%/g,a.index)+"\n\t\t\t\t\trule.cycleStack.pop(value);\n\t\t\t\t}\n\t\t\t",b,e))):(this.cache.set(a.schema,a),a.index=b.index,b.rules[b.index]=a,v=null!=c?c:"$$root",b.index++,c=a.ruleFunction.call(this,a,c,b),c.source=c.source.replace(/%%INDEX%%/g,a.index),c=new (b.async?L:Function)("value","field","parent","errors","context","label",c.source),b.fn[a.index]=c.bind(this),p.push(this.wrapRequiredCheckSourceCode(a,d.replace(/%%INDEX%%/g,a.index),b,e)),p.push(this.makeCustomValidator({vName:e,
path:v,schema:a.schema,context:b,messages:a.messages,ruleIndex:a.index})),this.opts.debug&&console.log(this._formatter("// Context.fn["+a.index+"]\n"+c.toString())));return p.join("\n")};f.prototype.getRuleFromSchema=function(a){a=this.resolveType(a);var b=this.aliases[a.type];b&&(delete a.type,a=B(a,b,{skipIfExist:!0}));b=this.rules[a.type];if(!b)throw Error("Invalid '"+a.type+"' type in validator schema.");return{messages:Object.assign({},this.messages,a.messages),schema:B(a,this.defaults[a.type],
{skipIfExist:!0}),ruleFunction:b}};f.prototype.parseShortHand=function(a){a=a.split("|").map(function(d){return d.trim()});var b=a[0];var c=b.endsWith("[]")?this.getRuleFromSchema({type:"array",items:b.slice(0,-2)}).schema:{type:a[0]};a.slice(1).map(function(d){var e=d.indexOf(":");if(-1!==e){var p=d.substr(0,e).trim();d=d.substr(e+1).trim();"true"===d||"false"===d?d="true"===d:Number.isNaN(Number(d))||(d=Number(d));c[p]=d}else d.startsWith("no-")?c[d.slice(3)]=!1:c[d]=!0});return c};f.prototype.makeError=
function(a){var b=a.type,c=a.field,d=a.expected,e=a.actual,p={type:'"'+b+'"',message:'"'+a.messages[b]+'"'};p.field=c?'"'+c+'"':"field";null!=d&&(p.expected=d);null!=e&&(p.actual=e);p.label="label";return"errors.push({ "+Object.keys(p).map(function(v){return v+": "+p[v]}).join(", ")+" });"};f.prototype.makeCustomValidator=function(a){var b=a.vName;void 0===b&&(b="value");var c=a.fnName;void 0===c&&(c="custom");var d=a.ruleIndex,e=a.path,p=a.schema,v=a.context,A=a.messages;a="rule"+d;var z="fnCustomErrors"+
d;if("function"==typeof p[c]){v.customs[d]?(v.customs[d].messages=A,v.customs[d].schema=p):v.customs[d]={messages:A,schema:p};if(this.opts.useNewCustomCheckerFunction)return"\n \t\tconst "+a+" = context.customs["+d+"];\n\t\t\t\t\tconst "+z+" = [];\n\t\t\t\t\t"+b+" = "+(v.async?"await ":"")+a+".schema."+c+".call(this, "+b+", "+z+" , "+a+'.schema, "'+e+'", parent, context);\n\t\t\t\t\tif (Array.isArray('+z+" )) {\n \t\t"+z+" .forEach(err => errors.push(Object.assign({ message: "+
a+".messages[err.type], field }, err)));\n\t\t\t\t\t}\n\t\t\t\t";p="res_"+a;return"\n\t\t\t\tconst "+a+" = context.customs["+d+"];\n\t\t\t\tconst "+p+" = "+(v.async?"await ":"")+a+".schema."+c+".call(this, "+b+", "+a+'.schema, "'+e+'", parent, context);\n\t\t\t\tif (Array.isArray('+p+")) {\n\t\t\t\t\t"+p+".forEach(err => errors.push(Object.assign({ message: "+a+".messages[err.type], field }, err)));\n\t\t\t\t}\n\t\t"}return""};f.prototype.add=function(a,b){this.rules[a]=b};f.prototype.addMessage=
function(a,b){this.messages[a]=b};f.prototype.alias=function(a,b){if(this.rules[a])throw Error("Alias name must not be a rule name");this.aliases[a]=b};f.prototype.plugin=function(a){if("function"!==typeof a)throw Error("Plugin fn type must be function");return a(this)};f.prototype.resolveType=function(a){var b=this;if("string"===typeof a)a=this.parseShortHand(a);else if(Array.isArray(a)){if(0===a.length)throw Error("Invalid schema.");a={type:"multi",rules:a};a.rules.map(function(p){return b.getRuleFromSchema(p)}).every(function(p){return!0===
p.schema.optional})&&(a.optional=!0);a.rules.map(function(p){return b.getRuleFromSchema(p)}).every(function(p){return!0===p.schema.nullable})&&(a.nullable=!0)}if(a.$$type){var c=this.getRuleFromSchema(a.$$type).schema;delete a.$$type;var d=Object.assign({},a),e;for(e in a)delete a[e];B(a,c,{skipIfExist:!0});a.props=d}return a};f.prototype.normalize=function(a){var b=this,c=this.resolveType(a);this.aliases[c.type]&&(c=B(c,this.normalize(this.aliases[c.type]),{skipIfExists:!0}));c=B(c,this.defaults[c.type],
{skipIfExist:!0});if("multi"===c.type)return c.rules=c.rules.map(function(d){return b.normalize(d)}),c.optional=c.rules.every(function(d){return!0===d.optional}),c;if("array"===c.type)return c.items=this.normalize(c.items),c;"object"===c.type&&c.props&&Object.entries(c.props).forEach(function(d){return c.props[d[0]]=b.normalize(d[1])});"object"===typeof a&&(a.type?(a=this.normalize(a.type),B(c,a,{skipIfExists:!0})):Object.entries(a).forEach(function(d){return c[d[0]]=b.normalize(d[1])}));return c};
return f}"object"===typeof exports&&"undefined"!==typeof module?module.exports=G():"function"===typeof define&&define.amd?define(G):(F="undefined"!==typeof globalThis?globalThis:F||self,F.FastestValidator=G())

@@ -8,2 +8,13 @@ "use strict";

let sanitized = false;
if (schema.convert === true) {
sanitized = true;
// Convert to array if not and the value is not null or undefined
src.push(`
if (!Array.isArray(value) && value != null) {
value = [value];
}
`);
}
src.push(`

@@ -103,4 +114,5 @@ if (!Array.isArray(value)) {

return {
sanitized,
source: src.join("\n")
};
};
{
"name": "fastest-validator",
"version": "1.15.0",
"version": "1.16.0",
"description": "The fastest JS validator library for NodeJS",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -489,2 +489,15 @@ ![Photos from @ikukevk](https://user-images.githubusercontent.com/306521/30183963-9c722dca-941c-11e7-9e83-c78377ad7f9d.jpg)

**Example for `convert`:**
```js
const schema = {
roles: { type: "array", items: 'string', convert: true }
}
const check = v.compile(schema);
check({ roles: ["user"] }); // Valid
check({ roles: "user" }); // Valid
// After both validation: roles = ["user"]
```
### Properties

@@ -501,2 +514,3 @@ Property | Default | Description

`items` | `null` | Schema for array items.
`convert`| `null` | Wrap value into array if different type provided

@@ -503,0 +517,0 @@ ## `boolean`

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc