diff --git a/CHANGELOG.md b/CHANGELOG.md index ee8fa355a..5c4e40016 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/decorators/unions.ts b/src/decorators/unions.ts index b064d1b87..e69c7eef7 100644 --- a/src/decorators/unions.ts +++ b/src/decorators/unions.ts @@ -85,13 +85,18 @@ export function createUnionType( ] >, ): T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9 | T10; +export function createUnionType({ + types, + name, + description, +}: UnionTypeConfig): ClassType[]; // #endregion -export function createUnionType({ types, name, description }: UnionTypeConfig) { - const unionMetadata = getMetadataStorage().collectUnionMetadata({ +export function createUnionType({ types, name, description }: UnionTypeConfig): any { + const unionMetadataSymbol = getMetadataStorage().collectUnionMetadata({ types, name, description, }); - return unionMetadata; + return unionMetadataSymbol; }