Skip to main content
Module

x/pretty_benching/mod.ts>ColumnDefinition

:sauropod: A small lib to make your Deno benchmarking progress and results look pretty
Latest
interface ColumnDefinition
import { type ColumnDefinition } from "https://deno.land/x/pretty_benching@v0.3.3/mod.ts";

Defines one column of the markdown table.

Properties

title: string

Defines the title of the column

optional
propertyKey: string

Defines which property of the BenchmarkResult should be displayed, if no formatter is defined.

Note: custom propertyKey-s can be used, but values has to be manually mapped onto each BenchmarkResult.

optional
align: "left" | "center" | "right"

Defines how the column should be aligned. Defaults to center

optional
toFixed: number

Calls number.toFixed(x) with this value, when defined and the cell value is a number.

Also used on formatter output values.

optional
formatter: (result: BenchmarkResult, columnDef: ColumnDefinition) => string

Allows to calculate custom cell values based on the BenchmarkResult, and its own ColumnDefinition.

The value will be - for falsy values, and * when no propertyKey and formatter was provided

Its favoured above propertyKey, when both is defined.