Skip to content

Commit

Permalink
Don't overwrite variables if the key is present. Affects variables wi…
Browse files Browse the repository at this point in the history
…th randomness
  • Loading branch information
ThinkThoughtThunk committed Oct 1, 2020
1 parent e71c21f commit 23cab77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ function aggregateResults(results: Evaluation[][]): Evaluation[] {
(acc, evaluation) =>
didFail(evaluation)
? (acc[evaluation.variable] = 'Error - check this variable\'s code', acc)
: acc[evaluation.variable]
: acc.hasOwnProperty(evaluation.variable)
? acc
: (acc[evaluation.variable] = evaluation.result || '', acc),
: (acc[evaluation.variable] = evaluation.result as string, acc),
map);

const eitherErrorOrEvaluationsMap = (evaluations: Evaluation[]) =>
Expand Down

0 comments on commit 23cab77

Please sign in to comment.