• For records following the recordModel schema

    Type Parameters

    • T

    Parameters

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

      Schema of the record

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

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

    Since 0.0.12

  • For records following the recordModel schema

    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 string | number | symbol]: T[K] }, TConstraints>>

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

    Since 0.0.12