Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logger.error('Could not find external references', err)
}
})
yield* merge(findLocalReferences(), findExternalReferences()).pipe(
// Same-repo references
// Cross-repo references
// Find canonical source location
filter(chunk => chunk.length > 0),
tap({
next: chunk => {
span.log({ event: 'chunk', count: chunk.length })
},
}),
// Rewrite URIs and convert from LSP to Sourcegraph Location
map(chunk =>
chunk
.map(location => {
try {
return convertLocation({
...location,
uri: toSourcegraphTextDocumentUri(new URL(location.uri)).href,
})
} catch (err) {
return undefined
}
})
.filter((location): location is Exclude => !!location)
),
// Aggregate individual chunks into a growing array (which is what Sourcegraph expects)
scan(
(allReferences, chunk) => allReferences.concat(chunk),
smartContract.iterLogs = (
actionFilter?: ActionFilter,
): AsyncIterable =>
AsyncIterableX.from(smartContract.iterActions(actionFilter)).pipe(
map(action => {
if (action.type === 'Notification') {
return (null: $FlowFixMe);
}
return action.message;
}),
filter(Boolean),
);
keys(): StackItemEnumerator<> {
const iterable = AsyncIterableX.from(this.enumerator).pipe(
map(({ key }) => ({ value: key })),
);
return new StackItemEnumerator(this._getIterator(iterable));
}
values(): StackItemEnumerator<> {
const iterable = AsyncIterableX.from(this.enumerator).pipe(
map(({ value }) => ({ value })),
);
return new StackItemEnumerator(this._getIterator(iterable));
}
}