Skip to content

Commit

Permalink
fix: fixed s.array type inference
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Jul 10, 2022
1 parent ebc46de commit d60737a
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 d60737a

Please sign in to comment.