Skip to content

Commit

Permalink
fix: add prop to swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
mdovhopo committed Feb 7, 2022
1 parent 59c5c52 commit 6250143
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/decorators/is-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ function validateObjectSize(
return optional;
}

const { length } = Object.keys(obj);
return check(length);
return check(Object.keys(obj).length);
}

export const IsObject = <T extends Record<string, unknown>>({
Expand All @@ -29,7 +28,7 @@ export const IsObject = <T extends Record<string, unknown>>({
}
> = {}): PropertyDecorator =>
compose(
{ type: 'object', minProperties },
{ type: 'object', minProperties, maxProperties },
base,
IsObjectCV({ each: !!base.isArray, message }),
minProperties
Expand Down

0 comments on commit 6250143

Please sign in to comment.