We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isStringArray is a type guard that lets Typescript know that the variable passed in is an array of strings (string[]).
string[]
Note
This is just a wrapper for makeArrayGuard with isString.
candidate: unknown
Supply any variable to test if it’s an array of strings (string[]) or not.
A type predicate for an array of strings (candidate is string[]).
candidate is string[]
import { isStringArray } from '@revolutionarygamesco/common' isStringArray(['hello!']) // true isStringArray([]) // true isStringArray('hello!') // false isStringArray(['hello!', 42]) // false isStringArray({ a: 'hello!' }) // false isStringArray(42) // false