UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

13 lines (12 loc) 358 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.booleanMajority = void 0; /** * Returns true if most flags are true. * @author @dailker */ function booleanMajority(...flags) { const count = flags.filter(Boolean).length; return count > flags.length / 2; } exports.booleanMajority = booleanMajority;