Skip to content

Commit

Permalink
fix(union): fix createUnionType overload signatures (10 limit bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalLytek committed Aug 14, 2018
1 parent 8720670 commit 802b4ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog and release notes

## Unreleased
### Fixes
- fix missing loosely typed overload signature for `createUnionType` (remove the 10 types limit)

## v0.13.0
### Features
- make `class-validator` a virtual peer dependency and update it to newest `0.9.1` version
Expand Down
11 changes: 8 additions & 3 deletions src/decorators/unions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ export function createUnionType<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
]
>,
): T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9 | T10;
export function createUnionType({
types,
name,
description,
}: UnionTypeConfig<ClassType[]>): ClassType[];
// #endregion
export function createUnionType({ types, name, description }: UnionTypeConfig<ClassType[]>) {
const unionMetadata = getMetadataStorage().collectUnionMetadata({
export function createUnionType({ types, name, description }: UnionTypeConfig<ClassType[]>): any {
const unionMetadataSymbol = getMetadataStorage().collectUnionMetadata({
types,
name,
description,
});

return unionMetadata;
return unionMetadataSymbol;
}

0 comments on commit 802b4ba

Please sign in to comment.