Skip to content

Commit

Permalink
feat: Simplify hasValue check
Browse files Browse the repository at this point in the history
Signed-off-by: Jorgen Ader <[email protected]>
  • Loading branch information
jorgenader committed Nov 19, 2024
1 parent 08e737c commit 2a1ec07
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/is/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ export const isArray = Array.isArray; // eslint-disable-line prefer-destructurin

export const hasValue = <T = any>(
value: T | undefined | null
): value is Exclude<T, null | undefined> =>
typeof value !== 'undefined' && value !== null;
): value is NonNullable<T> => typeof value !== 'undefined' && value !== null;

type IsFunction<T> = T extends (...args: any[]) => any ? T : never;
export const isFunction = <
Expand Down

0 comments on commit 2a1ec07

Please sign in to comment.