Splits a diff string into an array of chunks, where each chunk represents a single file.
Each chunk is a string that contains the full diff of a file, including the hunk headers.
A hunk header has the format @@ -REMOVED,LINES +ADDED,LINES @@, and specifies the number of lines that were removed or added.
@@ -REMOVED,LINES +ADDED,LINES @@
Here is an example of a chunk:
diff --git a/AuthorizationClientService.ts b/AuthorizationClientService.tsindex 6cacefd..2c1b136 100644--- a/AuthorizationClientService.ts+++ b/AuthorizationClientService.ts@@ -2,10 +2,10 @@ import { RequestClient } from "./RequestClient"; import { LogService } from "./LogService";-import { isString } from "./modules/lodash"; import { RequestError } from "./request/types/RequestError"; import { RequestStatus } from "./request/types/RequestStatus"; import { AuthorizationUtils } from "./AuthorizationUtils";+import { isString } from "./types/String"; const LOG = LogService.createLogger('AuthorizationClientService');
A chunk starts with an optional diff --git line, followed by an optional index HASH1..HASH2 PERMISSIONS line, followed by ---, +++, and @@ lines, and then the actual diff. The chunk ends when a new diff --git line is encountered.
diff --git
index HASH1..HASH2 PERMISSIONS
---
+++
@@
An array of chunks
The diff string to split into chunks
Generated using TypeDoc
Splits a diff string into an array of chunks, where each chunk represents a single file.
Each chunk is a string that contains the full diff of a file, including the hunk headers.
A hunk header has the format
@@ -REMOVED,LINES +ADDED,LINES @@
, and specifies the number of lines that were removed or added.Here is an example of a chunk:
A chunk starts with an optional
diff --git
line, followed by an optionalindex HASH1..HASH2 PERMISSIONS
line, followed by---
,+++
, and@@
lines, and then the actual diff. The chunk ends when a newdiff --git
line is encountered.Returns
An array of chunks