• For records following the recordModel schema

    Example

    record({ x: someArbitraryInt, y: someArbitraryInt }): Arbitrary<{x:number,y:number}>
    // merge two integer arbitraries to produce a {x, y} record

    Remarks

    Since 0.0.12

    Type Parameters

    • T

    Parameters

    • recordModel: { [ K in string | number | symbol]: Arbitrary<T[K]> }

      Schema of the record

    Returns Arbitrary<RecordValue<{ [ K in keyof T]: T[K] }>>

  • For records following the recordModel schema

    Example

    record({ x: someArbitraryInt, y: someArbitraryInt }, {withDeletedKeys: true}): Arbitrary<{x?:number,y?:number}>
    // merge two integer arbitraries to produce a {x, y}, {x}, {y} or {} record

    Remarks

    Since 0.0.12

    Type Parameters

    Parameters

    • recordModel: { [ K in string | number | symbol]: Arbitrary<T[K]> }

      Schema of the record

    • constraints: TConstraints

      Contraints on the generated record

    Returns Arbitrary<RecordValue<{ [ K in keyof T]: T[K] }, TConstraints>>

Generated using TypeDoc