Remove unsed parts of result-keys.ts

This commit is contained in:
Asger F
2022-10-07 16:26:56 +02:00
parent 5a694653d7
commit f759eed0f5

View File

@@ -36,9 +36,6 @@ export interface PathNode extends ResultKeyBase {
export type ResultKey = Result | Path | PathNode;
/** Alias for `undefined` but more readable in some cases */
export const none: PathNode | undefined = undefined;
/**
* Looks up a specific result in a result set.
*/
@@ -76,15 +73,6 @@ export function getPathNode(sarif: sarif.Log, key: PathNode): sarif.Location | u
return path.locations[key.pathNodeIndex]?.location;
}
/**
* Returns true if the two keys are both `undefined` or contain the same set of indices.
*/
export function equals(key1: Partial<PathNode> | undefined, key2: Partial<PathNode> | undefined): boolean {
if (key1 === key2) return true;
if (key1 === undefined || key2 === undefined) return false;
return key1.resultIndex === key2.resultIndex && key1.pathIndex === key2.pathIndex && key1.pathNodeIndex === key2.pathNodeIndex;
}
/**
* Returns true if the two keys contain the same set of indices and neither are `undefined`.
*/