From efbcb07ebaf48538cc3632f916e2f3dfb97ebb34 Mon Sep 17 00:00:00 2001 From: AshGw Date: Thu, 18 Apr 2024 02:02:37 +0100 Subject: [PATCH] chore: setup PoC for all types --- src/index.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index b0f49a53..ad45445d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -174,7 +174,6 @@ export type Stretch = T extends object : never : T; -const _ = Symbol('_'); export type TypeGuard = (_: any) => _ is T; export type FilterBy = { @@ -224,3 +223,17 @@ export function final(target: T): T { } }; } + +export type IfSame = T extends P ? Yes : No; +export type ShallowEquals = X extends Y ? true : false; +export type Equals = (() => T extends X ? true : false) extends < + T, +>() => T extends Y ? true : false + ? true + : false; + +export type MutableKeys = keyof { + [P in Keys as Equals, Readonly>> extends true + ? never + : P]: never; +};