Budgets from your full months, the middle value per category, and say which months

A half month at the start of your history or one unusual month no longer sets the budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
minimus7andClaude Opus 5.5 committed 2026-11-09 10:09:14 -06:00
1 parent c3276ab5c1
commit 37a97fe20a
6 files changed
+40 -15

No files matched your search

+8
View File
@@ -60,3 +60,11 @@ console.log("budget: ok");
]);
assert.deepEqual(budgetChanges({ Coffee: null }, cats, {}), []); // nothing to remove
}
// The usual month: one big month doesn't set the budget.
import { median as med, monthList as ml } from "./budget.ts";
assert.equal(med([120, 900, 140]), 140);
assert.equal(med([100, 200]), 150);
assert.equal(med([]), 0);
assert.equal(ml(["2026-10", "2026-08", "2026-09"]), "August, September and October");
assert.equal(ml(["2026-10"]), "October");