ignore invalid journal entries
This commit is contained in:
parent
840ce06397
commit
04acf069d1
@ -132,7 +132,15 @@ export const _mergeFlags = (recent, stale, allFlagKeys) => {
|
||||
}
|
||||
|
||||
const _mergeJournal = (...journals) => {
|
||||
const allJournals = flatten(journals.map(j => Array.isArray(j) ? j : []))
|
||||
// Ignore invalid journal entries
|
||||
const allJournals = flatten(
|
||||
journals.map(j => Array.isArray(j) ? j : [])
|
||||
).filter(entry =>
|
||||
Object.prototype.hasOwnProperty.call(entry, 'path') &&
|
||||
Object.prototype.hasOwnProperty.call(entry, 'operation') &&
|
||||
Object.prototype.hasOwnProperty.call(entry, 'args') &&
|
||||
Object.prototype.hasOwnProperty.call(entry, 'timestamp')
|
||||
)
|
||||
const grouped = groupBy(allJournals, 'path')
|
||||
const trimmedGrouped = Object.entries(grouped).map(([path, journal]) => {
|
||||
// side effect
|
||||
|
Loading…
Reference in New Issue
Block a user