Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleLanguageChange = item => {
const {type, onChange} = this.props
const path = ['language']
onChange(PatchEvent.from([
setIfMissing({_type: type.name}),
item ? set(item.value, path) : unset(path)
]))
}
handleToggleSelectLine = line => {
const {type, onChange} = this.props
const path = ['highlightedLines']
const highlightedLines = xor(this.props.value.highlightedLines, [line]).sort(compareNumbers)
onChange(PatchEvent.from([
setIfMissing({_type: type.name, highlightedLines: []}),
line ? set(highlightedLines, path) : unset(path)
]))
}