validate_property: Validate a property against a given type or validation...

View source: R/validate_property.R

validate_propertyR Documentation

Validate a property against a given type or validation function

Description

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.

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

Value

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


interface documentation built on Sept. 11, 2024, 8:59 p.m.