Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
autoCompleteLeafs() {
const { insertions, result } = fillLeafs(
this.props.schema,
this.props.query,
) as {
insertions: Array<{ index: number; string: string }>
result: string
}
if (insertions && insertions.length > 0) {
const editor = this.queryEditorComponent.getCodeMirror()
editor.operation(() => {
const cursor = editor.getCursor()
const cursorIndex = editor.indexFromPos(cursor)
editor.setValue(result)
let added = 0
try {
/* tslint:disable-next-line */
const markers = insertions.map(({ index, string }) =>