Skip to content

Commit

Permalink
fix: fixed s.array type inference (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
favna authored Jul 10, 2022
1 parent ebc46de commit a5948dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/Shapes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ export class Shapes {
return new UnionValidator(validators);
}

public array<T>(validator: BaseValidator<T[][number]>): ArrayValidator<T[], T[][number]>;
public array<T extends unknown[]>(validator: BaseValidator<T[number]>): ArrayValidator<T, T[number]>;
public array<T extends unknown[]>(validator: BaseValidator<T[number]>) {
return new ArrayValidator(validator);
}
Expand Down

0 comments on commit a5948dc

Please sign in to comment.