GuardedStruct.Derive.SanitizerDerive (GuardedStruct v0.1.0-beta.1)

Copy Markdown View Source

Built-in sanitizer ops. Every clause follows the pipe-friendly sanitize(value, op) argument order:

"  Hello  " |> SanitizerDerive.sanitize(:trim) |> SanitizerDerive.sanitize(:downcase)
# => "hello"

Summary

Functions

Apply a user-defined sanitizer module's sanitize/2 callback. The callback receives the value first and the op atom second.

Functions

call(arg, actions)

@spec call(
  {atom(), any()},
  [any()]
) :: {any(), any()}

sanitize(input, action)

@spec sanitize(any(), atom() | tuple()) :: any()

validate_pattern(module, input, action)

@spec validate_pattern(module(), any(), atom()) :: any()

Apply a user-defined sanitizer module's sanitize/2 callback. The callback receives the value first and the op atom second.