View Source Tamnoon.DOM (Tamnoon v1.0.0-rc.3)

Summary

Functions

Raises an ArgumentError if check_fun.(value) evaluates to false. Returns :ok otherwise.

Functions

Link to this function

validate_type!(value, check_fun, struct_module)

View Source
@spec validate_type!(
  value :: any(),
  check_fun :: (term() -> boolean()),
  struct_module :: module()
) :: :ok

Raises an ArgumentError if check_fun.(value) evaluates to false. Returns :ok otherwise.

Example

validate_type!(node, &Tamnoon.DOM.Node.is_node?/1, Tamnoon.DOM.Node)