⚡️ feat: create a type for merge two interface but keep the last value
This commit is contained in:
parent
100e03b7a4
commit
d181e6ba98
9
packages/frontend/src/types/common.ts
Normal file
9
packages/frontend/src/types/common.ts
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Construct a type by excluding common keys from one type to another.
|
||||
* @template T - The type from which to omit properties.
|
||||
* @template U - The type whose properties to omit from T.
|
||||
* @param {T} - The source type.
|
||||
* @param {U} - The target type.
|
||||
* @returns A new type that includes all properties from T except those that are common with U.
|
||||
*/
|
||||
export type OmitCommon<T, U> = Pick<T, Exclude<keyof T, keyof U>>;
|
Loading…
Reference in New Issue
Block a user