Hey, let's play a small game all you have to do is fill all these text fileds. To help you,
you can read the rule that is implemented below.
Good luck!
const email = new Rule({
type: 'email',
domain: d => ['hotmail', 'outlook', 'gmail'].indexOf(d) !== -1,
});
const PhoneNumber = new Rule({
type: 'string-int',
minLength: 10,
maxLength: 10,
match: /0(7|6).*/,
})
const PassWord = new Rule({
type: 'password',
minLength: 8,
maxLength: 10,
matchesOneOf: ['@', '_', '-', '.', '?', '$'],
numbers: 1,
uppercase: 1,
});
const url = new Rule({
type: 'url',
domain: domain => domain === 'github.com',
protocol: protocol => protocol === 'https',
});
const country = new Rule({
type: 'string',
oneOf: ['FR', 'US', 'EN'],
});
const zipcode = new Rule({
type: 'string-int',
minLength: 5,
maxLength: 5,
});
const street = new Rule({
type: 'string',
notEmpty: true,
});
const streetNumber = new Rule({
type: 'string-int',
});
Last game.
Edit the code so that you have at least two valid tests!