dm_validate() checks the internal consistency of a dm object.

## Usage

dm_validate(x)

x

An object.

## Value

Returns the dm, invisibly, after finishing all checks.

## Details

In theory, with the exception of new_dm(), all dm objects created or modified by functions in this package should be valid, and this function should not be needed. Please file an issue if any dm operation creates an invalid object.

## Examples

dm_validate(dm())

#> Error in abort_dm_invalid("A dm needs to be a list of one item named def.") :
#>   This dm is invalid, reason: A dm needs to be a list of one item named def.