• 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:

    diff --git a/AuthorizationClientService.ts b/AuthorizationClientService.ts
    index 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.

    Returns

    An array of chunks

    Parameters

    • diffString: string

      The diff string to split into chunks

    Returns string[]

Generated using TypeDoc