@@ -126,7 +126,7 @@ internals.input = async function (source, request) {
126
126
const schema = request . route . settings . validate [ source ] ;
127
127
const bind = request . route . settings . bind ;
128
128
129
- var value = await ( typeof schema !== 'function' ? internals . validate ( request [ source ] , schema , localOptions ) : schema . call ( bind , request [ source ] , localOptions ) ) ;
129
+ var value = await ( typeof schema !== 'function' ? schema . validateAsync ( request [ source ] , localOptions ) : schema . call ( bind , request [ source ] , localOptions ) ) ;
130
130
return ;
131
131
}
132
132
catch ( err ) {
@@ -217,7 +217,7 @@ exports.response = async function (request) {
217
217
let value ;
218
218
219
219
if ( typeof schema !== 'function' ) {
220
- value = await internals . validate ( source , schema , localOptions ) ;
220
+ value = await schema . validateAsync ( source , localOptions ) ;
221
221
}
222
222
else {
223
223
value = await schema ( source , localOptions ) ;
@@ -238,13 +238,3 @@ exports.response = async function (request) {
238
238
return request . _core . toolkit . failAction ( request , request . route . settings . response . failAction , err , { tags : [ 'validation' , 'response' , 'error' ] } ) ;
239
239
}
240
240
} ;
241
-
242
-
243
- internals . validate = function ( value , schema , options ) {
244
-
245
- if ( typeof schema . validateAsync === 'function' ) {
246
- return schema . validateAsync ( value , options ) ;
247
- }
248
-
249
- return schema . validate ( value , options ) ;
250
- } ;
0 commit comments