Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tennashi/deno-diff-manipulator

Manipulate diff
https://github.com/tennashi/deno-diff-manipulator

Last synced: 22 days ago
JSON representation

Manipulate diff

Awesome Lists containing this project

README

        

# diff_manipulator
Manipulate diff

## Usage
```ts
import { parse } from "https://deno.land/x/diff_parser";
import { removeHunk, removeHunksBefore, removeHunksAfter } from "https://deno.land/x/diff_manipulator";

const process = Deno.run({
cmd: ["git", "diff", "--no-color"],
stdout: "piped",
})

const output = await process.output();
const diffText = new TextDecoder().decode(output);
process.close();

const diff = parse(diffText);

removeHunk(diff, 1);
removeHunksBefore(diff, 1);
removeHunksAfter(diff, 1);
```