Volder Versions Save

volder is powerful Object schema validation lets you describe your data using a simple and readable schema and transform a value to match the requirements

2.0.3

2 years ago
import { Volder } from 'volder';

const personSchema = new Volder({
  name:{ type: String, required: true, maxLength: 10, trim: true },
  age: { type: Number, min: 18, sign: 'positive' }
})

const { valid, errors, value } = personSchema.validate({name: "max  ", age: 19}); // we forget adding a validate function.
// { valid: true, errors: {}, value: {name: "max", age: 19}}

2.0.2

2 years ago

fix: email validation, first index contain letter , accept some symbols src/lib/volder-types/email.js

export const Email = (input) => {
  const regex = /^[\w.~!#$%&'*+-/=?^_`{|]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,6}$/;
  const code = String(input).charCodeAt(0);

  if (!(code > 64 && code < 91) && !(code > 96 && code < 123)) {
    return false;
  }
  return regex.test(String(input))
};

2.0.1

2 years ago

fix volder publish to npm issue

2.0.0

2 years ago

volder comes with major things and feature to improve validation and simplify to the developer to complete here work with full patiant

1.3.3

2 years ago

change from importing Volder as defualt to be in an object

import { Volder } from 'volder';

1.3.2

2 years ago

fix nested schema issues

1.3.1

2 years ago

the clear and public release

  • some bugs fixes

1.3.0

2 years ago

features

  • support schema volder typess ( nested volder)
  • add trim , min and max to null type
  • add custom type by adding your function

1.1.1

2 years ago

add custom error message by doing array

const volderSchema  = new Volder({
  name:{
type:[String, 'type should be string']
})

1.0.1

2 years ago
  • trim property option to trim the string before validating
  • boolean case
  • just constructor function