Skip to content

Wrong inferred type of prop when using oneOf method #62

@IgorSzymanski

Description

@IgorSzymanski

oneOf<T = any>(arr: T[]): VueTypeDef<T[], T>

I believe that line should look like this:

oneOf<T = any>(arr: T[]): VueTypeDef<T, T>

Currently, if I do something like this:

props: {
		id: VueTypes.oneOf([0, 1]).isRequired,
	},

Typescript assumes that prop id is of type number[], but it should be number instead.

Tested it locally, and after the change, it works as - I assume - intended.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions