Releases: devSupporters/volder
Releases · devSupporters/volder
2.0.3: update license and fix readme typo in usage section.
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}}
fix: email validation, first index contain letter , accept some symbols
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))
};
fix volder publish to npm issue
fix volder publish to npm issue
new volder and new things
volder comes with major things and feature to improve validation and simplify to the developer to complete here work with full patiant
some changes
change from importing Volder as defualt to be in an object
import { Volder } from 'volder';
1.3.2 fix
fix nested schema issues
1.3.1
the clear and public release
- some bugs fixes
1.3.0
features
- support schema volder typess ( nested volder)
- add trim , min and max to null type
- add custom type by adding your function
custom error message and clean code
add custom error message by doing array
const volderSchema = new Volder({
name:{
type:[String, 'type should be string']
})
more features added:
- trim property option to trim the string before validating
- boolean case
- just constructor function