1
common/resources/client/utils/ts/nullable.ts
Executable file
1
common/resources/client/utils/ts/nullable.ts
Executable file
@@ -0,0 +1 @@
|
||||
export type Nullable<T> = {[K in keyof T]: T[K] | null};
|
||||
7
common/resources/client/utils/ts/obj-has-key.ts
Executable file
7
common/resources/client/utils/ts/obj-has-key.ts
Executable file
@@ -0,0 +1,7 @@
|
||||
export function objHasKey<X extends {}, Y extends PropertyKey>(
|
||||
obj: X,
|
||||
prop: Y
|
||||
): obj is X & Record<Y, unknown> {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
return obj.hasOwnProperty(prop);
|
||||
}
|
||||
1
common/resources/client/utils/ts/partial-with-required.ts
Executable file
1
common/resources/client/utils/ts/partial-with-required.ts
Executable file
@@ -0,0 +1 @@
|
||||
export type PartialWithRequired<T, K extends keyof T> = Pick<T, K> & Partial<T>;
|
||||
Reference in New Issue
Block a user