From 84f79ffe7cbd1939703551cc4e4ebcf43910f34e Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 10 Oct 2022 13:34:02 -0500 Subject: [PATCH] Remove undefined props --- common/calculate-metrics.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/calculate-metrics.ts b/common/calculate-metrics.ts index 0302aa31..9cd1a57a 100644 --- a/common/calculate-metrics.ts +++ b/common/calculate-metrics.ts @@ -11,6 +11,7 @@ import { PortfolioMetrics, User } from './user' import { DAY_MS } from './util/time' import { getBinaryCpmmBetInfo, getNewMultiBetInfo } from './new-bet' import { getCpmmProbability } from './calculate-cpmm' +import { removeUndefinedProps } from './util/object' const computeInvestmentValue = ( bets: Bet[], @@ -275,11 +276,11 @@ export const calculateMetricsByContract = ( ) } - return { + return removeUndefinedProps({ contractId: c.id, ...current, from: periodMetrics, - } + }) }) }