Skip to content

@jsvision/datagrid / isAggregateFn

Function: isAggregateFn()

isAggregateFn(fn): fn is AggregateFn

Defined in: datagrid/src/aggregate.ts:46

Type guard: whether fn names a known AggregateFn. Used at the footer config boundary to drop an aggregate whose fn is not one of the built-in reductions (rather than fold with it).

Parameters

fn

string

The candidate reduction name.

Returns

fn is AggregateFn

true (narrowing fn to AggregateFn) when it is a known reduction.

Example

ts
import { isAggregateFn } from '@jsvision/datagrid';
isAggregateFn('sum');    // true
isAggregateFn('median'); // false