MasatoDev / boostest

14 stars 0 forks source link

union type is not working [at type alias] #8

Closed MasatoDev closed 2 months ago

MasatoDev commented 2 months ago

union type is not working as below.

type TestType = 'hoge' | 'huga'
const testtype = boostestTestType<TestType>()

result.

export function boostestTestType<T>(args?: Partial<T>): T {
    return ({
        ...args
    } as T);
}
MasatoDev commented 2 months ago

The same applies in below.

const type = Array<Hoge | Huga>
MasatoDev commented 2 months ago

done it! https://github.com/MasatoDev/boostest/pull/12