Skip to content

Commit

Permalink
fix: use literal true and false in `DiffResultTextFile | DiffResu…
Browse files Browse the repository at this point in the history
…ltBinaryFile` to aid type assertions.
  • Loading branch information
steveukx committed Jul 29, 2021
1 parent 0f75aa4 commit 8059099
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/unit/log.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListLogSummary, SimpleGit } from 'typings';
import { LogResult, SimpleGit } from 'typings';
import {
assertExecutedCommands,
assertExecutedCommandsContains,
Expand Down Expand Up @@ -523,7 +523,7 @@ ${START_BOUNDARY}207601debebc170830f2921acf2b6b27034c3b1f::2016-01-03 15:50:58 +

describe('deprecations', () => {
it('supports ListLogSummary without generic type', async () => {
const summary: Promise<ListLogSummary> = git.log({from: 'from', to: 'to'});
const summary: Promise<LogResult> = git.log({from: 'from', to: 'to'});
await closeWithSuccess();

expect(summary).not.toBe(undefined);
Expand Down
4 changes: 2 additions & 2 deletions typings/response.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ export interface DiffResultTextFile {
changes: number;
insertions: number;
deletions: number;
binary: boolean;
binary: false;
}

export interface DiffResultBinaryFile {
file: string;
before: number;
after: number;
binary: boolean;
binary: true;
}

export interface DiffResult {
Expand Down

0 comments on commit 8059099

Please sign in to comment.