Skip to content

Commit

Permalink
OV-29: * remove as suggested in review all helpers of null and undefi…
Browse files Browse the repository at this point in the history
…end values
  • Loading branch information
lfelix3011 committed Aug 23, 2024
1 parent 634bdfb commit 80b0bcf
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 30 deletions.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/src/bundles/common/helpers/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
export { isEmptyArray } from './array-helper/array-helper.js';
export { isNullOrUndefined } from './is-null-or-undefined/is-null-or-undefined.js';
export { isStringNullOrEmpty } from './string-helpers/string-helper.js';
export { configureString } from 'shared';

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 2 additions & 6 deletions frontend/src/bundles/video-editor/components/menu/menu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { Box, Flex, VStack } from '~/bundles/common/components/components.js';
import {
isEmptyArray,
isNullOrUndefined,
} from '~/bundles/common/helpers/helpers.js';
import { useCallback } from '~/bundles/common/hooks/hooks.js';

import { type MenuItem } from '../../types/types.js';
Expand All @@ -17,12 +13,12 @@ const Menu: React.FC<Properties> = ({ items, activeIndex, setActiveIndex }) => {
const handleClick = useCallback(
(index: number) => {
return () => {
if (isEmptyArray(items) || index >= items.length) {
if (!items || items.length === 0 || index >= items.length) {
return;
}

const item = items[index];
if (isNullOrUndefined(item)) {
if (!item) {
return;
}

Expand Down

0 comments on commit 80b0bcf

Please sign in to comment.