Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 1x 1x 1x 8x 8x 8x 2x 6x 6x 6x | import * as FileOp from 'fs/operations-with-permissions/file-operations'; import * as OutputFactory from 'emulator-output/output-factory'; const DEFAULT_LINE_COUNT = 10; export const trimFileContent = (fs, filePath, options, trimmingFn) => { const {file, err} = FileOp.readFile(fs, filePath); if (err) { return { err: OutputFactory.makeErrorOutput(err) }; }; const linesCount = options.lines ? Number(options.lines) : DEFAULT_LINE_COUNT; const trimmedLines = trimmingFn(file.get('content').split('\n'), linesCount); return { content: trimmedLines.join('\n') }; }; |