Move escapeWhitespace to diffs and add small test

This commit is contained in:
Sebastian Sdorra
2020-09-02 07:40:52 +02:00
parent 4f060e4b24
commit 95dde51bba
4 changed files with 25 additions and 13 deletions

View File

@@ -39,3 +39,7 @@ export function createHunkIdentifier(file: File, hunk: Hunk) {
export function createHunkIdentifierFromContext(ctx: BaseContext) {
return createHunkIdentifier(ctx.file, ctx.hunk);
}
export function escapeWhitespace(path: string) {
return path.toLowerCase().replace(/\W/g, "-");
}