Skip to content

Commit

Permalink
fix(typebox): Add TRecord to getValidator arg1 type (#3488)
Browse files Browse the repository at this point in the history
  • Loading branch information
jd1378 committed May 19, 2024
1 parent 01bc333 commit ffbcc0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/typebox/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
TSchema,
ObjectOptions,
TIntersect,
TUnion
TUnion,
type TRecord
} from '@sinclair/typebox'
import { jsonSchema, Validator, DataValidatorMap, Ajv } from '@feathersjs/schema'

Expand All @@ -27,7 +28,7 @@ export type TDataSchemaMap = {
* @returns A compiled validation function
*/
export const getValidator = <T = any, R = T>(
schema: TObject | TIntersect | TUnion<TObject[]>,
schema: TObject | TIntersect | TUnion<TObject[]> | TRecord,
validator: Ajv
): Validator<T, R> => jsonSchema.getValidator(schema as any, validator)

Expand Down

0 comments on commit ffbcc0a

Please sign in to comment.