Renamed nullable utils into isDefined and isUndefinedOrNull (#4402)

* Renamed nullable utils into isDefined and isUndefinedOrNull
This commit is contained in:
Lucas Bordeau
2024-03-11 14:28:57 +01:00
committed by GitHub
parent 3f15cc5b7a
commit 581dfafe11
169 changed files with 469 additions and 493 deletions

View File

@ -0,0 +1,15 @@
import { isDefined } from '~/utils/isDefined';
describe('isDefined', () => {
it('returns true if value is not undefined nor null', () => {
expect(isDefined('')).toBe(true);
});
it('returns false if value is null', () => {
expect(isDefined(null)).toBe(false);
});
it('returns false if value is undefined', () => {
expect(isDefined(undefined)).toBe(false);
});
});

View File

@ -1,15 +0,0 @@
import { isNonNullable } from '~/utils/isNonNullable';
describe('isNonNullable', () => {
it('returns true if value is not undefined nor null', () => {
expect(isNonNullable('')).toBe(true);
});
it('returns false if value is null', () => {
expect(isNonNullable(null)).toBe(false);
});
it('returns false if value is undefined', () => {
expect(isNonNullable(undefined)).toBe(false);
});
});