ansman / validate.js

A declarative validation library written javascript
https://validatejs.org
MIT License
2.63k stars 336 forks source link

equality error #330

Open Alarees opened 4 years ago

Alarees commented 4 years ago

i have error in equality attribute my code :

const constraints = {
  trader_password: {
    presence: { allowEmpty: false, message: "empty message" },
    length: {
      maximum: 128,
    },
  passwordConfirm: {
    presence: { allowEmpty: false, message: empty },
    equality: {
        attribute:"trader_password",
        message : "my message"
     },
  }
};

validate({trader_password:"1234",passwordConfirm:"1234"}, constraints);
// => {passwordConfirm: ["my message"]}

PS : i already read this issues #222