UNPKG

studiocms

Version:

Astro Native CMS for AstroDB. Built from the ground up by the Astro community.

20 lines (19 loc) 945 B
import type { WebVitalsResponseItem, WebVitalsSummary } from './types.js'; /** * Processes an array of web vitals response items and generates a summary. * * @param data - An array of `WebVitalsResponseItem` objects to be processed. * @returns A `WebVitalsSummary` object containing the processed summary. * * The function performs the following steps: * 1. Groups the input data by the `name` property. * 2. Processes each metric group separately. * 3. Sorts the metrics within each group by `rating` and `value`. * 4. Assigns quartiles to each metric. * 5. Identifies the end of each rating group. * 6. Computes the sample size for each metric group. * 7. Computes histogram densities for each rating. * 8. Computes the 75th percentile (P75) for each metric group. * 9. Filters the final results based on specific conditions. */ export declare function processWebVitalsSummary(data: WebVitalsResponseItem[]): WebVitalsSummary;