Skip to content

hasAll

ts
function Flags.hasAll(target: number, flags: Iterable<Flag>): boolean

Checks if all specified flags are set in the bitmask.

Example

ts
import { Flags } from "@monstermann/flags";

Flags.hasAll(7, [0, 1]); // true
Flags.hasAll(7, [0, 3]); // false
ts
import { Flags } from "@monstermann/flags";

pipe(7, Flags.hasAll([0, 1])); // true
pipe(7, Flags.hasAll([0, 3])); // false