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

@ -2,7 +2,7 @@ import { Options, useHotkeys } from 'react-hotkeys-hook';
import { Keys } from 'react-hotkeys-hook/dist/types';
import { useRecoilState } from 'recoil';
import { isNonNullable } from '~/utils/isNonNullable';
import { isDefined } from '~/utils/isDefined';
import { pendingHotkeyState } from '../states/internal/pendingHotkeysState';
@ -58,7 +58,7 @@ export const useSequenceHotkeys = (
setPendingHotkey(null);
if (isNonNullable(options.preventDefault)) {
if (isDefined(options.preventDefault)) {
keyboardEvent.stopImmediatePropagation();
keyboardEvent.stopPropagation();
keyboardEvent.preventDefault();

View File

@ -1,6 +1,6 @@
import { useRecoilCallback } from 'recoil';
import { isNonNullable } from '~/utils/isNonNullable';
import { isDefined } from '~/utils/isDefined';
import { DEFAULT_HOTKEYS_SCOPE_CUSTOM_SCOPES } from '../constants/DefaultHotkeysScopeCustomScopes';
import { currentHotkeyScopeState } from '../states/internal/currentHotkeyScopeState';
@ -30,7 +30,7 @@ export const useSetHotkeyScope = () =>
.getValue();
if (currentHotkeyScope.scope === hotkeyScopeToSet) {
if (!isNonNullable(customScopes)) {
if (!isDefined(customScopes)) {
if (
isCustomScopesEqual(
currentHotkeyScope?.customScopes,