diff --git a/.gitignore b/.gitignore index 2946d00bdf7b..e2a50cb343d3 100644 --- a/.gitignore +++ b/.gitignore @@ -132,4 +132,4 @@ frontend/static/webfonts-preview .turbo frontend/.env.sentry-build-plugin .claude/worktrees -1024MiB \ No newline at end of file +1024MiB diff --git a/frontend/src/ts/utils/json-data.ts b/frontend/src/ts/utils/json-data.ts index 3151e9ce5daa..0437db6dbd37 100644 --- a/frontend/src/ts/utils/json-data.ts +++ b/frontend/src/ts/utils/json-data.ts @@ -52,7 +52,7 @@ export function memoizeAsync( const key = getKey ? getKey(...args) : (args[0] as P); const cached = cache.get(key); - if (cached) { + if (cached !== undefined) { return cached; } diff --git a/packages/util/src/numbers.ts b/packages/util/src/numbers.ts index ce29b3cb313e..347ce5925ac8 100644 --- a/packages/util/src/numbers.ts +++ b/packages/util/src/numbers.ts @@ -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) / + n, ); } catch (e) { return 0;