This file contains hidden or 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
/* eslint-disable guard-for-in, @typescript-eslint/ban-types, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-assignment */ | |
// The nullToUndefined solution is based on these two solutions: | |
// | |
// https://stackoverflow.com/a/72549576/10580490 | |
// https://gist.github.com/tkrotoff/a6baf96eb6b61b445a9142e5555511a0 | |
// | |
// While undefinedToNull is just the reverse of it. | |
export type NullToUndefined<T> = T extends null | undefined |