synopsize
Version:
Print out a synopsis of values from a stream of newline-delimited JSON objects
34 lines (33 loc) • 1.02 kB
TypeScript
export interface ColumnSynopsis<T> {
/**
The name of the datatype that can be used to hold all observed non-null values.
*/
typeName: string;
/**
A copy of the input array.
*/
values: T[];
/**
A subset of values for which isEmpty returns false.
*/
nonEmptyValues: T[];
/**
The first value, after sorting using the default compareFunction definition
(convert values to strings and sort lexicographically).
*/
minimum: T;
/**
The last value, after sorting using the default compareFunction definition
(convert values to strings and sort lexicographically).
*/
maximum: T;
/**
Frequency tabulation mapping observed non-null values to the total number of
observations. The number of null values can be derived as `total - totalNotNull`
*/
counts: Map<T, number>;
}
/**
@param {string[]} values - A column of values that are similar in some way.
*/
export declare function synopsize<T>(values: T[]): ColumnSynopsis<T>;