Skip to content

Commit 802b4ba

Browse files
committed
fix(union): fix createUnionType overload signatures (10 limit bug)
1 parent 8720670 commit 802b4ba

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog and release notes
22

3+
## Unreleased
4+
### Fixes
5+
- fix missing loosely typed overload signature for `createUnionType` (remove the 10 types limit)
6+
37
## v0.13.0
48
### Features
59
- make `class-validator` a virtual peer dependency and update it to newest `0.9.1` version

src/decorators/unions.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,18 @@ export function createUnionType<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
8585
]
8686
>,
8787
): T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9 | T10;
88+
export function createUnionType({
89+
types,
90+
name,
91+
description,
92+
}: UnionTypeConfig<ClassType[]>): ClassType[];
8893
// #endregion
89-
export function createUnionType({ types, name, description }: UnionTypeConfig<ClassType[]>) {
90-
const unionMetadata = getMetadataStorage().collectUnionMetadata({
94+
export function createUnionType({ types, name, description }: UnionTypeConfig<ClassType[]>): any {
95+
const unionMetadataSymbol = getMetadataStorage().collectUnionMetadata({
9196
types,
9297
name,
9398
description,
9499
});
95100

96-
return unionMetadata;
101+
return unionMetadataSymbol;
97102
}

0 commit comments

Comments
 (0)