js-validator-livr icon indicating copy to clipboard operation
js-validator-livr copied to clipboard

not_one_of string rule

Open one-more opened this issue 7 years ago • 3 comments

one-more avatar Sep 10 '17 08:09 one-more

Thank you for the request. We want to leave this repo compatible with the spec. Extra rules (not covered by the spec) will be placed to another repo. It will be published soon

koorchik avatar Sep 21 '17 08:09 koorchik

@one-more Could you describe the real use case for this rule? When we need it?

koorchik avatar Sep 25 '17 07:09 koorchik

for example when we adding item to the list and want it to be unique.

   const userRoles = ['administrator', 'user', 'conntent manager'];
   const schema = {
       roleName: ['required', 'not_empty', {not_one_of: userRoles}]        
   }

one-more avatar Sep 25 '17 07:09 one-more