Check if a format is supported
Usage
is_valid_format(x, stop_otherwise = FALSE)
Arguments
- x
either format string or an object returned by sprintf_format
- stop_otherwise
logical, if x
is not a format should an error be
thrown
Value
TRUE
if x
is NULL
, a supported format string, or a function; FALSE
otherwise.
Note
No check if the function is actually a formatter is performed.
Examples
is_valid_format("xx.x")
#> [1] TRUE
is_valid_format("fakeyfake")
#> [1] FALSE