Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
isDefinedOn(node: Node): boolean {
// We could probably return true here (since every node has a key), but it's never called
// so just leaving unimplemented for now.
throw assertionError('KeyIndex.isDefinedOn not expected to be called.');
}
Path.Empty,
write.children
);
} else {
const child = safeGet(write.children, relativePath.getFront());
if (child) {
// There exists a child in this node that matches the root path
const deepNode = child.getChild(relativePath.popFront());
compoundWrite = compoundWrite.addWrite(Path.Empty, deepNode);
}
}
} else {
// There is no overlap between root path and write path, ignore write
}
} else {
throw assertionError('WriteRecord should have .snap or .children');
}
}
}
return compoundWrite;
}
}
Change.childAddedChange(childKey, change.snapshotNode)
);
} else if (
type === Change.CHILD_CHANGED &&
oldType === Change.CHILD_CHANGED
) {
this.changeMap.set(
childKey,
Change.childChangedChange(
childKey,
change.snapshotNode,
oldChange.oldSnap
)
);
} else {
throw assertionError(
'Illegal combination of changes: ' +
change +
' occurred after ' +
oldChange
);
}
} else {
this.changeMap.set(childKey, change);
}
}
private compareChanges_(a: Change, b: Change) {
if (a.childName == null || b.childName == null) {
throw assertionError('Should only compare child_ events.');
}
const aWrapped = new NamedNode(a.childName, a.snapshotNode);
const bWrapped = new NamedNode(b.childName, b.snapshotNode);
return this.index_.compare(aWrapped, bWrapped);
}
}
oldViewCache,
ackUserWrite.path,
writesCache,
completeCache,
accumulator
);
}
} else if (operation.type === OperationType.LISTEN_COMPLETE) {
newViewCache = this.listenComplete_(
oldViewCache,
operation.path,
writesCache,
accumulator
);
} else {
throw assertionError('Unknown operation type: ' + operation.type);
}
const changes = accumulator.getChanges();
ViewProcessor.maybeAddValueEvent_(oldViewCache, newViewCache, changes);
return new ProcessorResult(newViewCache, changes);
}