Skip to content

isBooleanArray

Jason Godesky edited this page Aug 14, 2026 · 1 revision

isBooleanArray is a type guard that lets Typescript know that the variable passed in is an array of boolean values (boolean[]).

Note

This is just a wrapper for makeArrayGuard with isBoolean.

Parameters

candidate: unknown

Supply any variable to test if it’s an array of boolean values (boolean[]) or not.

Returns

A type predicate for an array of boolean values (candidate is boolean[]).

Examples

import { isBooleanArray } from '@revolutionarygamesco/common'

isBooleanArray([true, true, false]) // true
isBooleanArray([true, true, 0]) // false
isBooleanArray('hello!') // false
isBooleanArray({ a: true }) // false

Clone this wiki locally