27 lines
857 B
Plaintext
27 lines
857 B
Plaintext
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.dedupeDocumentSpans = exports.dedupeReferencedSymbols = void 0;
|
|
function dedupeReferencedSymbols(items) {
|
|
return dedupe(items, item => [
|
|
item.definition.fileName,
|
|
item.definition.textSpan.start,
|
|
item.definition.textSpan.length,
|
|
].join(':'));
|
|
}
|
|
exports.dedupeReferencedSymbols = dedupeReferencedSymbols;
|
|
function dedupeDocumentSpans(items) {
|
|
return dedupe(items, item => [
|
|
item.fileName,
|
|
item.textSpan.start,
|
|
item.textSpan.length,
|
|
].join(':'));
|
|
}
|
|
exports.dedupeDocumentSpans = dedupeDocumentSpans;
|
|
function dedupe(items, getKey) {
|
|
const map = new Map();
|
|
for (const item of items.reverse()) {
|
|
map.set(getKey(item), item);
|
|
}
|
|
return [...map.values()];
|
|
}
|
|
//# sourceMappingURL=dedupe.js.map |