UNPKG
typescript-type
Version:
latest (0.0.10)
0.0.10
0.0.9
Typescript type
github.com/onalbi/typescript-type
onalbi/typescript-type
typescript-type
/
types
/
object.ts
5 lines
(3 loc)
•
243 B
text/typescript
View Raw
1
2
3
4
5
export
type
AreSame
<
T1
,
T2
> =
T1
extends
T2
? (
T2
extends
T1
?
true
:
false
) :
false
;
export
type
OneOfProp
<T, K
extends
keyof T = keyof T> =
Omit
<T, K> & { [I
in
K]-?:
Required
<
Pick
<T, I>> &
Partial
<
Record
<
Exclude
<K, I>,
undefined
>> }[K];