Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equal implementation #279

Closed
unional opened this issue Apr 1, 2023 · 0 comments
Closed

Equal implementation #279

unional opened this issue Apr 1, 2023 · 0 comments

Comments

@unional
Copy link
Owner

unional commented Apr 1, 2023

Here is another implementation of Equal that almost work.

Keeping it here for reference:

	BothNever<
		A,
		B,
		Then,
		Else,
		BothAny<
			A,
			B,
			Then,
			Else,
			And<
				IsSymbol<A>,
				IsSymbol<B>,
				Then,
				And<
					IsObject<A>,
					IsObject<B>,
					And<
						IsFunction<A>,
						IsFunction<B>,
						[A, B] extends [B, A] ? Then : Else,
						Properties<A> extends infer PA
							? Properties<B> extends infer PB
								? (<_>() => _ extends (PA & _) | _ ? 1 : 2) extends <_>() => _ extends (PB & _) | _ ? 1 : 2
									? [PA, PB] extends [A, B]
										? Then
										: Else
									: Else
								: never
							: never
					>,
					[A, B] extends [B, A] ? Then : Else
				>
			>
		>
	>
@unional unional closed this as completed Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant