This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ExcludeNull<T> = { | |
[K in keyof T]-?: null extends T[K] ? Exclude<T[K], null> : T[K]; | |
}; | |
/** | |
* Filters out any `null` values and makes them `undefined`. | |
* It also filters out the type of the object so the TS parser understands it. | |
* @param obj Object containing null types | |
* @returns | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'reflect-metadata'; | |
import { InputHTMLAttributes } from 'react'; | |
import { ClassConstructor } from 'class-transformer'; | |
export type InputOptions = Omit< | |
InputHTMLAttributes<HTMLInputElement>, | |
'name' | |
> & { | |
label?: string; | |
}; |
OlderNewer