From d181e6ba98c3190936b0d61b19b1d6fde5ad9b43 Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Sat, 24 Feb 2024 11:42:22 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20feat:=20create=20a=20type?= =?UTF-8?q?=20for=20merge=20two=20interface=20but=20keep=20the=20last=20va?= =?UTF-8?q?lue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/types/common.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 packages/frontend/src/types/common.ts diff --git a/packages/frontend/src/types/common.ts b/packages/frontend/src/types/common.ts new file mode 100644 index 00000000..fc796289 --- /dev/null +++ b/packages/frontend/src/types/common.ts @@ -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 = Pick>;