Skip to content

Commit a965afa

Browse files
committed
Refactor: Simplify null/undefined expression
1 parent a0e5af9 commit a965afa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/utils/object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import type { OmitIndexSignature, ReadonlyKeysOf, RequiredKeysOf, SetRequired, Simplify } from 'type-fest';
2121

22-
const filterNullishValues = (value: unknown): boolean => value !== undefined && value !== null;
22+
const filterNullishValues = (value: unknown): boolean => value != null;
2323

2424
/**
2525
* Copy and remove null and undefined values

lib/utils/string-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function customCamelCase(string: string): string {
2727
}
2828

2929
function checkStringIsValid(string: string) {
30-
if (string === undefined || string === null) {
30+
if (string == null) {
3131
throw new Error('The passed string cannot be nil.');
3232
}
3333
}

0 commit comments

Comments
 (0)