Skip to content

Commit

Permalink
fix: isEmpty defaults to false
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Mar 31, 2022
1 parent 101e6f1 commit 128311f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/n4s/src/rules/__tests__/isEmpty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ describe('Tests isEmpty rule', () => {
it('Should return true for NaN', () => {
expect(isEmpty(NaN)).toBe(true);
});

it('Should return false for a Symbol', () => {
expect(isEmpty(Symbol('hey'))).toBe(false);
});
});
});
2 changes: 1 addition & 1 deletion packages/n4s/src/rules/isEmpty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function isEmpty(value: unknown): boolean {
return lengthEquals(Object.keys(value as Record<string, unknown>), 0);
}

return true;
return false;
}

export const isNotEmpty = bindNot(isEmpty);

0 comments on commit 128311f

Please sign in to comment.