# IsEqual

`type` in `plugins` · v0.6.1

<https://docs.seedcord.org/packages/plugins/0.6.1/types/is-equal-2>

Returns a boolean for whether the two given types are equal.

 https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650   https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796

Use-cases: - If you want to make a conditional branch based on the result of a comparison of two types.

## Examples

```ts
import type {IsEqual} from 'type-fest';

// This type returns a boolean for whether the given array includes the given item.
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
type Includes<Value extends readonly any[], Item> =
	Value extends readonly [Value[0], ...infer rest]
		? IsEqual<Value[0], Item> extends true
			? true
			: Includes<rest, Item>
		: false;

 Type Guard   Utilities
```

## Declaration

```ts
type IsEqual<A, B> = [A] extends [B]
    ? [B] extends [A]
        ? _IsEqual<A, B>
        : false
    : false;
```
