Type Parameters
- T extends string = string
Parameters
- key: string
- value: unknown
Optional
checkFn: (value: string) => value is T
Returns undefined | T[]
undefined
if the input contains no non-empty values (after
trimming whitespace on left/right from each), otherwise a non-empty array of
values.
Returns an array of strings from the given list while validating each one using the
checkFn
function.If it returns without throwing, the input is necessarily valid. If the result is an empty array, it will return
null
.Throws
LisnUsageError If the input is not a string or array of strings, or if any entries do not pass
checkFn
.