UNPKG

quantitivecalc

Version:

A TypeScript library providing advanced quantitative finance functions for risk analysis, performance metrics, and technical indicators. (Currently in development)

22 lines (21 loc) 1.11 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = findExtremesInColumn; const all_1 = require("./../ListUtils/all"); const applyFunctionToFlattened_1 = __importDefault(require("./applyFunctionToFlattened")); /** * Finds the minimum and maximum values in a specified column across all lists in a dictionary. * * @template T - The type of objects contained in the lists. * @template K - The key of the column to find extremes for. * @param dict - A dictionary where each key maps to an array of objects of type T. * @param columnName - The key of the column to evaluate for extremes. * @returns An object containing the minimum (`min`) and maximum (`max`) values found in the specified column, * or `undefined` if no values are present. */ function findExtremesInColumn(dict, columnName) { return (0, applyFunctionToFlattened_1.default)(dict, list => all_1.listUtils.findExtremesInColumn(list, columnName)); }