Skip to content

Commit

Permalink
refactor: Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
erayhanoglu committed Nov 21, 2024
1 parent f4ee3ea commit 9ecbdbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/omit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export function omitUndefined<T>(
obj: T,
deep?: boolean,
): DeeperOmitTypes<T, undefined> {
/* istanbul ignore next */
if (!(obj && typeof obj === 'object')) return obj as any;
let v: any;
for (const k of Object.keys(obj)) {
Expand All @@ -19,6 +20,7 @@ export function omitUndefined<T>(
}

export function omitNull<T>(obj: T, deep?: boolean): DeeperOmitTypes<T, null> {
/* istanbul ignore next */
if (!(obj && typeof obj === 'object')) return obj as any;
let v: any;
for (const k of Object.keys(obj)) {
Expand All @@ -36,6 +38,7 @@ export function omitNullish<T>(
obj: T,
deep?: boolean,
): DeeperOmitTypes<T, null | undefined> {
/* istanbul ignore next */
if (!(obj && typeof obj === 'object')) return obj as any;
let v: any;
for (const k of Object.keys(obj)) {
Expand Down

0 comments on commit 9ecbdbd

Please sign in to comment.