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!

Your score
0/ 100

Let's try some Rules:

Email rule:


const email = new Rule({
  type: 'email',
  domain: d => ['hotmail', 'outlook', 'gmail'].indexOf(d) !== -1,
});

Custom rule:


const PhoneNumber = new Rule({
  type: 'string-int',
  minLength: 10,
  maxLength: 10,
  match: /0(7|6).*/,
})

Password rule:


const PassWord = new Rule({
    type: 'password',
    minLength: 8,
    maxLength: 10,
    matchesOneOf: ['@', '_', '-', '.', '?', '$'],
    numbers: 1,
    uppercase: 1,
  });
        

Url rule:


const url = new Rule({
  type: 'url',
  domain: domain => domain === 'github.com',
  protocol: protocol => protocol === 'https',
});
        

Multiple Rules:


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',
});

Play arround

Edit this code to try some Rules

Last game.
Edit the code so that you have at least two valid tests!

Congratulations !

I'm happy to tell you that you have learned how to use forgJs.
I hope you like it, please let me know.
If you find any mistakes, please feel free to contact me on GitHub or Twitter