Playwright harness under scripts/browser: 127.0.0.1 server with the DEPLOY CSP, export and import baselines of the TypeScript engine under a 4 GiB RSS watchdog (not a guaranteed memory limit), O9 browser columns in inflate.browsers.json (26 rows agree with Node in all three engines). Results of 2026-10-18 committed; the O9 Node test no longer expects browser columns in inflate.json.
22 lines
742 B
JavaScript
22 lines
742 B
JavaScript
/** Small descriptive statistics for the summary tables. */
|
|
|
|
const sorted = (values) => [...values].sort((a, b) => a - b)
|
|
|
|
export function median(values) {
|
|
const list = sorted(values)
|
|
if (list.length === 0) return null
|
|
const mid = Math.floor(list.length / 2)
|
|
return list.length % 2 ? list[mid] : (list[mid - 1] + list[mid]) / 2
|
|
}
|
|
|
|
/** Median and range of the finite numbers of `values` (nulls skipped). */
|
|
export function spread(values) {
|
|
const list = sorted(values.filter((v) => Number.isFinite(v)))
|
|
if (list.length === 0) return null
|
|
const min = list[0]
|
|
const max = list[list.length - 1]
|
|
return { n: list.length, median: median(list), min, max }
|
|
}
|
|
|
|
export const sum = (values) => values.reduce((total, v) => total + v, 0)
|