Skip to content

Commit

Permalink
Remove asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
trizotti committed Oct 13, 2022
1 parent 6e89706 commit d9fea15
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
10 changes: 0 additions & 10 deletions lib/types/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ module.exports = Any.extend({
greater: {
method(limit) {

Assert(limit !== undefined, 'limit is required');

return this.$_addRule({ name: 'greater', method: 'compare', args: { limit }, operator: '>' });
}
},
Expand All @@ -146,35 +144,27 @@ module.exports = Any.extend({
less: {
method(limit) {

Assert(limit !== undefined, 'limit is required');

return this.$_addRule({ name: 'less', method: 'compare', args: { limit }, operator: '<' });
}
},

max: {
method(limit) {

Assert(limit !== undefined, 'limit is required');

return this.$_addRule({ name: 'max', method: 'compare', args: { limit }, operator: '<=' });
}
},

min: {
method(limit) {

Assert(limit !== undefined, 'limit is required');

return this.$_addRule({ name: 'min', method: 'compare', args: { limit }, operator: '>=' });
}
},

multiple: {
method(base) {

Assert(base !== undefined, 'base is required');

return this.$_addRule({ name: 'multiple', args: { base } });
},
validate(value, helpers, { base }, options) {
Expand Down
2 changes: 0 additions & 2 deletions lib/types/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,6 @@ internals.isoDate = function (value) {

internals.length = function (schema, name, limit, operator, encoding) {

Assert(limit !== undefined, `${name} limit is required`);

Assert(!encoding || Buffer && Buffer.isEncoding(encoding), 'Invalid encoding:', encoding); // $lab:coverage:ignore$

return schema.$_addRule({ name, method: 'length', args: { limit, encoding }, operator });
Expand Down

0 comments on commit d9fea15

Please sign in to comment.