Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ frontend/static/webfonts-preview
.turbo
frontend/.env.sentry-build-plugin
.claude/worktrees
1024MiB
1024MiB
2 changes: 1 addition & 1 deletion frontend/src/ts/utils/json-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function memoizeAsync<P, Args extends unknown[], R>(
const key = getKey ? getKey(...args) : (args[0] as P);

const cached = cache.get(key);
if (cached) {
if (cached !== undefined) {
return cached;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/util/src/numbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export function stdDev(array: number[]): number {
const n = array.length;
const meanValue = mean(array);
return Math.sqrt(
array.map((x) => Math.pow(x - meanValue, 2)).reduce((a, b) => a + b) / n,
array.map((x) => Math.pow(x - meanValue, 2)).reduce((a, b) => a + b, 0) /
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is needed. reduce((a, b) => a + b) is a known summing pattern

Copy link
Copy Markdown
Author

@ennajari ennajari Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the surrounding try/catch already returns 0 if the array is empty, so the initial value has no effect. I'll revert this.

n,
);
} catch (e) {
return 0;
Expand Down
Loading