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

@ -6,7 +6,7 @@ import { CurrencyCode } from '@/object-record/record-field/types/CurrencyCode';
import { IconChevronDown } from '@/ui/display/icon';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
import { isNonNullable } from '~/utils/isNonNullable';
import { isDefined } from '~/utils/isDefined';
import { CurrencyPickerHotkeyScope } from '../types/CurrencyPickerHotkeyScope';
@ -77,7 +77,7 @@ export const CurrencyPickerDropdownButton = ({
useEffect(() => {
const currency = currencies.find(({ value }) => value === valueCode);
if (isNonNullable(currency)) {
if (isDefined(currency)) {
setSelectedCurrency(currency);
}
}, [valueCode, currencies]);

View File

@ -9,7 +9,7 @@ import { CountryCallingCode } from 'libphonenumber-js';
import { IconChevronDown, IconWorld } from '@/ui/display/icon';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
import { isNonNullable } from '~/utils/isNonNullable';
import { isDefined } from '~/utils/isDefined';
import { CountryPickerHotkeyScope } from '../types/CountryPickerHotkeyScope';
@ -113,7 +113,7 @@ export const CountryPickerDropdownButton = ({
useEffect(() => {
const country = countries.find(({ countryCode }) => countryCode === value);
if (isNonNullable(country)) {
if (isDefined(country)) {
setSelectedCountry(country);
}
}, [countries, value]);