Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const useEnhance = (hunks, oldSource, {language, editsType}) => {
const [hunksWithSourceExpanded, expandRange] = useSourceExpansion(hunks, oldSource);
const hunksWithMinLinesCollapsed = useMinCollapsedLines(5, hunksWithSourceExpanded, oldSource);
const [selection, toggleSelection] = useChangeSelect(hunksWithMinLinesCollapsed, {multiple: true});
const tokenizePayload = {
oldSource,
language,
editsType,
hunks: hunksWithMinLinesCollapsed,
};
const {tokens} = useTokenizeWorker(tokenize, tokenizePayload);
return {
expandRange,
selection,
toggleSelection,
tokens,
hunks: hunksWithMinLinesCollapsed,
};