• 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<RecordValue<{
        [K in keyof T]: T[K]
    }>>

    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

  • 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 keyof T]: T[K]
    }, TConstraints>>

    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

Generated using TypeDoc