rsuite / schema-typed

Schema for data modeling & validation
MIT License
198 stars 28 forks source link

ArrayType.of type error #33

Closed J3n5en closed 3 years ago

J3n5en commented 3 years ago
SchemaModel({
  numbers: ArrayType().of(
    StringType('asda'),
  ),
})

will throw

Error:(17, 5) TS2345: Argument of type 'StringType<any, string>' is not assignable to parameter of type 'ArrayType<any, string>'.
  Type 'StringType<any, string>' is missing the following properties from type 'ArrayType<any, string>': unrepeatable, of

👇👇👇 https://github.com/rsuite/schema-typed/blob/ed1d7f8230a719f26d606c2eb00e2f959e749ea4/src/ArrayType.ts#L69

type: CheckType<any[], DataType, E> should be type: CheckType<any, DataType, E> ?

thx.