Skip to main content

validation

Tiny utility library for validating function arguments

Status​

Stable: Functionality is covered by semantic versioning guarantees and unlikely to see breaking changes

Availability​

This module is preloaded. You can simply require it:

local validation = require("validation")

Functions​

validateBoolean​

Raises an error if the given argument is not a boolean value.

Available since: v0.0.1

validateFunction​

Raises an error if the given argument is not a function value.

Available since: v0.0.1

validateNumber​

Raises an error if the given argument is not a number value.

Available since: v0.0.1

validateString​

Raises an error if the given argument is not a string value.

Available since: v0.0.1

validateStruct​

Raises an error if the given argument is not a cdata value. The exact ctype is not checked in any way.

Available since: v0.0.1

validateTable​

Raises an error if the given argument is not a table value.

Available since: v0.0.1

validateThread​

Raises an error if the given argument is not a thread value (coroutine).

Available since: v0.0.1

validateUserdata​

Raises an error if the given argument is not a userdata value.

Available since: v0.0.1

Changelog​

VersionWhat happened?
v0.0.1Initial release