Skip to content

Commit 94410f8

Browse files
committed
fix(instanceOf): fix output type
1 parent cd32278 commit 94410f8

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ export const record = <K extends string | number | symbol, V>(
173173
value: Type<V>
174174
): RecordType<K, V> => new RecordType(key, value)
175175

176-
export const instanceOf = <T extends { new (...args: any[]): any }>(
177-
classType: T
178-
): Type<T> => new InstanceOfType(classType)
176+
export const instanceOf = <T>(classType: {
177+
new (...args: any[]): T
178+
}): Type<T> => new InstanceOfType(classType)
179179

180180
export const tuple = <T extends Type<any>[]>(
181181
...types: T

src/types/InstanceOfType.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import Type from './Type'
33
import getErrorMessage from '../getErrorMessage'
44
import Validation, { ErrorTuple, IdentifierPath } from '../Validation'
55

6-
export default class InstanceOfType<
7-
T extends { new (...args: any[]): any }
8-
> extends Type<T> {
6+
export default class InstanceOfType<T> extends Type<T> {
97
typeName = 'InstanceOfType'
10-
classType: T
8+
classType: { new (...args: any[]): T }
119

12-
constructor(classType: T) {
10+
constructor(classType: { new (...args: any[]): T }) {
1311
super()
1412
this.classType = classType
1513
}

0 commit comments

Comments
 (0)