quantitivecalc
Version:
A TypeScript library providing advanced quantitative finance functions for risk analysis, performance metrics, and technical indicators. (Currently in development)
18 lines • 1.18 kB
TypeScript
/**
* Filters a list of objects by a numeric or date range on a specified property.
*
* @template T - The type of objects in the list.
* @param list - The array of objects to filter.
* @param columnName - The key of the property to filter by.
* @param minValue - The minimum value (inclusive) for the property. If omitted or null, no minimum is applied.
* @param maxValue - The maximum value (inclusive) for the property. If omitted or null, no maximum is applied.
* @returns A new array containing only the objects where the specified property is within the given range.
*
* @remarks
* - Properties with `null`, `undefined`, or non-numeric/non-date values are excluded from the result.
* - Both `minValue` and `maxValue` are optional; if not provided or null, the corresponding bound is not checked.
* - Date values can be provided as Date objects or ISO strings.
* - Invalid date strings or non-numeric strings in min/max parameters are treated as no bound.
*/
export default function filterByRange<T>(list: T[], columnName: keyof T, minValue?: number | Date | string | null, maxValue?: number | Date | string | null): T[];
//# sourceMappingURL=filterByRange.d.ts.map