Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(canExpand, hunks) => {
if (canExpand) {
// Expand a normal section to demostrate util function
return expandCollapsedBlockBy(
expandFromRawCode(hunks, rawCode, 18, 22),
rawCode,
lines => lines <= 10
);
}
return hunks;
}
);
loadCollapsedCode(start, end) {
const {hunks} = this.state;
const hunksWithoutStub = last(hunks).content === 'STUB' ? hunks.slice(0, -1) : hunks;
const newHunks = expandFromRawCode(hunksWithoutStub, rawCodeLines, start, end);
this.setState({hunks: newHunks});
}