Skip to content

Commit

Permalink
Omit subIds
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 9, 2022
1 parent 3002b00 commit 6ec04a6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/history/merge/results.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import omit from 'omit.js'
import sortOn from 'sort-on'

import {
Expand Down Expand Up @@ -68,10 +69,19 @@ export const mergeResults = function (history, targetResult) {
}

const mergeResultsGroup = function (rawResults) {
const [rawResultsA, lastRawResult] = pickLast(rawResults)
return rawResultsA.reduceRight(mergeResultsPair, lastRawResult)
const rawResultsA = rawResults.map(omitUnmergedProps)
const [rawResultsB, lastRawResult] = pickLast(rawResultsA)
return rawResultsB.reduceRight(mergeResultsPair, lastRawResult)
}

// `subId` should be merged as an array of `subIds`. However, since it is not
// used except for filenames at the moment, we just omit it.
const omitUnmergedProps = function (rawResult) {
return omit.default(rawResult, UNMERGED_PROPS)
}

const UNMERGED_PROPS = ['subId']

// When merging timestamps, we only keep the most recent one:
// - I.e. when merging a new result, the timestamp of the group is updated
// - This is what most users would expect
Expand Down

0 comments on commit 6ec04a6

Please sign in to comment.