Skip to content

Commit

Permalink
Merge pull request #3 from ewerk/bugfix/fix-missing-types
Browse files Browse the repository at this point in the history
Add missing types
  • Loading branch information
iceteabottle authored Oct 11, 2024
2 parents a8bd28b + e544b53 commit be91a56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/has-empty-value/has-empty-value.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ describe('hasEmptyValue helper', () => {
it('should return true, if "empty" value was provided', () => {
expect(hasEmptyValue('')).toBe(true);
expect(hasEmptyValue([])).toBe(true);
expect(hasEmptyValue(null as unknown as string)).toBe(true);
expect(hasEmptyValue(undefined as unknown as string)).toBe(true);
expect(hasEmptyValue(null)).toBe(true);
expect(hasEmptyValue(undefined)).toBe(true);
});

it('should return false, if "non-empty" value was provided', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/has-empty-value/has-empty-value.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isNullOrUndefined } from '../is-null-or-undefined/is-null-or-undefined';

export const hasEmptyValue = (val: number | string | boolean | Array<any>): boolean => {
export const hasEmptyValue = (val: number | string | boolean | Array<any> | undefined | null): boolean => {
if (val instanceof Array) {
return val.length === 0;
}
Expand Down

0 comments on commit be91a56

Please sign in to comment.