Skip to content

Commit

Permalink
Variable formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Feb 1, 2023
1 parent 705ef93 commit 885753a
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 @@ -160,6 +160,7 @@ export const querySyntax = <
) => {
const propertySchema = queryProperties(type, extensions)
const $or = Type.Array(propertySchema)
const $and = Type.Array(Type.Union([propertySchema, Type.Object({ $or })]))

return Type.Intersect(
[
Expand All @@ -170,8 +171,8 @@ export const querySyntax = <
$skip: Type.Number({ minimum: 0 }),
$sort: sortDefinition(type),
$select: arrayOfKeys(type),
$or,
$and: Type.Array(Type.Union([propertySchema, Type.Object({ $or })]))
$and,
$or
},
{ additionalProperties: false }
)
Expand Down

0 comments on commit 885753a

Please sign in to comment.