Skip to contents

Validates a property to ensure it matches the expected type or satisfies the given validation function.

Usage

validate_property(name, value, validator)

Arguments

name

The name of the property being validated.

value

The value of the property.

validator

The expected type or a custom validation function.

Value

Returns NULL if the validation passes, otherwise returns a character string containing an error message describing why the validation failed.

Details

This function supports various types of validators: - Enum generators - Lists of multiple allowed types - Interface objects - Built-in R types (character, numeric, logical, integer, double, complex) - data.table and data.frame types - Custom validation functions