aggregatejs

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Added

[1.0.0] - 2026-01-30

Added

Changed

Migration Guide from v0.x to v1.0.0

If you’re upgrading from v0.x, be aware of these breaking changes:

Empty Array Handling

Before (v0.x):

max([]);  // returned 0
min([]);  // returned 0
sum([]);  // returned 0
count([]); // returned 0
percentile([], 0.5); // returned 0

After (v1.0.0):

max([]);  // throws RangeError: 'Array cannot be empty'
min([]);  // throws RangeError: 'Array cannot be empty'
sum([]);  // throws RangeError: 'Array cannot be empty'
count([]); // throws RangeError: 'Array cannot be empty'
percentile([], 0.5); // throws RangeError: 'Array cannot be empty'

Invalid Input Handling

Before (v0.x):

max([1, NaN, 3]);  // returned NaN or unexpected results

After (v1.0.0):

max([1, NaN, 3]);  // throws TypeError: 'All array elements must be finite numbers'

Array Mutation Fix

Before (v0.x):

const arr = [3, 1, 2];
median(arr);  // arr is now [1, 2, 3] - MUTATED!

After (v1.0.0):

const arr = [3, 1, 2];
median(arr);  // arr is still [3, 1, 2] - NOT MUTATED

To Migrate Your Code:

  1. Add try-catch blocks around aggregation function calls if you were relying on default return values for empty arrays
  2. Validate your input data before calling functions, or handle the new error types
  3. If you were working around the array mutation bug, you can now remove those workarounds

[0.0.5] - Previous Release