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.

15 lines (14 loc) 438 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.evaluateConditions = void 0; /** * Given an object of predicates or rules, evaluates which ones pass in a context. * @author @dailker */ function evaluateConditions(obj, context) { const result = {}; for (const k in obj) result[k] = obj[k](context); return result; } exports.evaluateConditions = evaluateConditions;