How to use the isDivisibleBy function from validator

Find comprehensive JavaScript validator.isDivisibleBy code examples handpicked from public code repositorys.

110
111
112
113
114
115
116
117
118
119
  }
  return true;
},
isDivisibleBy: function(rule, value) {
  if (rule) {
    return validator.isDivisibleBy(value, rule);
  }
  return true;
},
isByteLength: function(rule, value) {
fork icon0
star icon2
watch icon2

+ 5 other calls in file

95
96
97
98
99
100
101
102
103
104
    );
}

const bidIncrement = this.get('bidIncrement');
const diff = amount - openBidPrice;
const divisible = validator.isDivisibleBy(diff + '', bidIncrement);

if (!divisible) {
    throw new BidError(
        `Your bid must be $${openBidPrice} + a non-negative multiple of $${bidIncrement}`
fork icon0
star icon2
watch icon3