Skip to content

Commit

Permalink
fix: issue sindresorhus#788 added ifEqual guard - formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-pesto committed Jan 7, 2024
1 parent 5995215 commit ce9c716
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions source/if-equal.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IsEqual } from './is-equal';
import type {IsEqual} from './is-equal';

/**
* An if-else-like type that resolves depending on whether the two given types are equal.
Expand All @@ -7,7 +7,7 @@ import type { IsEqual } from './is-equal';
*
* @example
* ```
* import type { IfEqual } from 'type-fest';
* import type {IfEqual} from 'type-fest';
*
* type Result1 = IfEqual<string, string, 'Equal', 'NotEqual'>;
* //=> 'Equal'
Expand Down
8 changes: 4 additions & 4 deletions test-d/if-equal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectType, expectError } from 'tsd';
import type { IfEqual } from '../index';
import {expectType, expectError} from 'tsd';
import type {IfEqual} from '../index';

// `IfEqual` should return `true`/`false` if only `A` and `B` are specified
expectType<IfEqual<string, string>>(true);
Expand All @@ -10,8 +10,8 @@ expectType<IfEqual<string, string, 'Equal', 'NotEqual'>>('Equal');
expectType<IfEqual<string, number, 'Equal', 'NotEqual'>>('NotEqual');

// `IfEqual` should correctly handle complex types
expectType<IfEqual<{ a: number }, { a: number }>>(true);
expectType<IfEqual<{ a: number }, { b: number }>>(false);
expectType<IfEqual<{a: number}, {a: number}>>(true);
expectType<IfEqual<{a: number}, {b: number}>>(false);

// Missing generic parameters
expectError<IfEqual<string>>(undefined);
Expand Down

0 comments on commit ce9c716

Please sign in to comment.