diff --git a/lib/schema/int32.js b/lib/schema/int32.js index 69f612af28..5c10f37ac8 100644 --- a/lib/schema/int32.js +++ b/lib/schema/int32.js @@ -194,55 +194,6 @@ SchemaInt32.prototype.cast = function(value) { } }; -/*! - * ignore - */ - -SchemaInt32.$conditionalHandlers = { - ...SchemaType.prototype.$conditionalHandlers, - $gt: handleSingle, - $gte: handleSingle, - $lt: handleSingle, - $lte: handleSingle -}; - -/*! - * ignore - */ - -function handleSingle(val, context) { - return this.castForQuery(null, val, context); -} - -/** - * Casts contents for queries. - * - * @param {String} $conditional - * @param {any} val - * @api private - */ - -SchemaInt32.prototype.castForQuery = function($conditional, val, context) { - let handler; - if ($conditional != null) { - handler = SchemaInt32.$conditionalHandlers[$conditional]; - - if (handler) { - return handler.call(this, val); - } - - return this.applySetters(null, val, context); - } - - try { - return this.applySetters(val, context); - } catch (err) { - if (err instanceof CastError && err.path === this.path && this.$fullPath != null) { - err.path = this.$fullPath; - } - throw err; - } -}; /*! * Module exports.