Skip to content

Commit

Permalink
remove joi usage from Security Solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed May 5, 2021
1 parent 441bab8 commit bea1043
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import Boom from '@hapi/boom';
import Joi from 'joi';
import { errors } from '@elastic/elasticsearch';
import { has, snakeCase } from 'lodash/fp';
import { SanitizedAlert } from '../../../../../alerting/common';
Expand Down Expand Up @@ -233,7 +232,12 @@ export const transformBulkError = (
}
};

export const buildRouteValidation = <T>(schema: Joi.Schema): RouteValidationFunction<T> => (
interface Schema {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
validate: (input: any) => { value: any; error?: Error };
}

export const buildRouteValidation = <T>(schema: Schema): RouteValidationFunction<T> => (
payload: T,
{ ok, badRequest }
) => {
Expand Down

0 comments on commit bea1043

Please sign in to comment.