Add eqeqeq rule but require == for null
This commit is contained in:
parent
64a4d2e717
commit
0086216c9d
30 changed files with 64 additions and 63 deletions
|
@ -8,6 +8,7 @@ export type NullToUndefined<T> = Extract<T, null> extends never
|
|||
export function dropNull<T>(
|
||||
value: NonNullable<T> | null | undefined
|
||||
): T | undefined {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if (value === null) {
|
||||
return undefined;
|
||||
}
|
||||
|
@ -22,7 +23,7 @@ export function shallowDropNull<O extends { [key: string]: any }>(
|
|||
[Property in keyof O]: NullToUndefined<O[Property]>;
|
||||
}
|
||||
| undefined {
|
||||
if (value === null || value === undefined) {
|
||||
if (value == null) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue