RecordConstraints: ({ requiredKeys?: T[] } | { withDeletedKeys?: boolean }) & {
    noNullPrototype?: boolean;
}

Constraints to be applied on record

Type Parameters

  • T = unknown

Type declaration

  • { requiredKeys?: T[] }
    • OptionalrequiredKeys?: T[]

      List keys that should never be deleted.

      Remark: You might need to use an explicit typing in case you need to declare symbols as required (not needed when required keys are simple strings). With something like { requiredKeys: [mySymbol1, 'a'] as [typeof mySymbol1, 'a'] } when both mySymbol1 and a are required.

      Warning: Cannot be used in conjunction with withDeletedKeys.

      Array containing all keys of recordModel
      

      Since 2.11.0

  • { withDeletedKeys?: boolean }
    • OptionalwithDeletedKeys?: boolean

      Allow to remove keys from the generated record. Warning: Cannot be used in conjunction with requiredKeys. Prefer: requiredKeys: [] over withDeletedKeys: true

      false
      

      Since 1.0.0

      Prefer using requiredKeys: [] instead of withDeletedKeys: true as the flag will be removed in the next major

  • OptionalnoNullPrototype?: boolean

    Do not generate records with null prototype

    true
    

    Since 3.13.0

Since 0.0.12