refactor: optimize imports

This commit is contained in:
Ibrahima G. Coulibaly
2024-07-14 00:51:39 +01:00
parent 424436d07a
commit 3c5c0b9499
31 changed files with 59 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { duplicateList } from './service';
describe('duplicateList function', () => {

View File

@@ -1,10 +1,5 @@
import { expect, describe, it } from 'vitest';
import {
TopItemsList,
SplitOperatorType,
SortingMethod,
DisplayFormat
} from './service';
import { describe, expect, it } from 'vitest';
import { TopItemsList } from './service';
describe('TopItemsList function', () => {
it('should handle sorting alphabetically ignoring case', () => {

View File

@@ -2,7 +2,6 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import {
DisplayFormat,

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect } from 'vitest';
import { findUniqueCompute } from './service';

View File

@@ -2,7 +2,6 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { findUniqueCompute, SplitOperatorType } from './service';
import ToolInputAndResult from '../../../components/ToolInputAndResult';

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { groupList, SplitOperatorType } from './service';

View File

@@ -2,7 +2,6 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { groupList, SplitOperatorType } from './service';
import ToolInputAndResult from '../../../components/ToolInputAndResult';

View File

@@ -20,5 +20,6 @@ export const listTools = [
listWrap,
listRotate,
listShuffle,
listTruncate
listTruncate,
listDuplicate
];

View File

@@ -2,7 +2,6 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { reverseList, SplitOperatorType } from './service';
import ToolInputAndResult from '../../../components/ToolInputAndResult';

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect } from 'vitest';
import { reverseList } from './service';
describe('reverseList Function', () => {

View File

@@ -2,7 +2,6 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { rotateList, SplitOperatorType } from './service';
import ToolInputAndResult from '../../../components/ToolInputAndResult';

View File

@@ -1,5 +1,5 @@
import { expect, describe, it } from 'vitest';
import { SplitOperatorType, rotateList } from './service';
import { describe, expect, it } from 'vitest';
import { rotateList, SplitOperatorType } from './service';
describe('rotate function', () => {
it('should rotate right side if right is set to true', () => {

View File

@@ -1,4 +1,3 @@
import { isNumber } from 'utils/string';
export type SplitOperatorType = 'symbol' | 'regex';
function rotateArray(array: string[], step: number, right: boolean): string[] {

View File

@@ -2,13 +2,11 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { shuffleList, SplitOperatorType } from './service';
import ToolInputAndResult from '../../../components/ToolInputAndResult';
import SimpleRadio from '../../../components/options/SimpleRadio';
import TextFieldWithDesc from '../../../components/options/TextFieldWithDesc';
import { formatNumber } from '../../../utils/number';
import { isNumber } from '../../../utils/string';
const initialValues = {

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { shuffleList, SplitOperatorType } from './service';
describe('shuffle function', () => {

View File

@@ -2,7 +2,6 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { Sort, SortingMethod, SplitOperatorType } from './service';
import ToolInputAndResult from '../../../components/ToolInputAndResult';

View File

@@ -1,12 +1,12 @@
// Import necessary modules and functions
import { describe, it, expect } from 'vitest';
import { describe, expect, it } from 'vitest';
import {
alphabeticSort,
lengthSort,
numericSort,
Sort,
SplitOperatorType,
SortingMethod
SortingMethod,
SplitOperatorType
} from './service';
// Define test cases for the numericSort function

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { SplitOperatorType, truncateList } from './service';

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { unwrapList } from './service';
describe('unwrapList function', () => {

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { SplitOperatorType, wrapList } from './service';
describe('wrap function', () => {

View File

@@ -1,7 +1,6 @@
import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { listOfIntegers } from './service';
import ToolInputAndResult from '../../../components/ToolInputAndResult';

View File

@@ -2,7 +2,6 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { compute, NumberExtractionType } from './service';
import RadioWithTextField from '../../../components/options/RadioWithTextField';

View File

@@ -1,5 +1,5 @@
import { expect, describe, it } from 'vitest';
import { createPalindromeList, createPalindrome } from './service';
import { describe, expect } from 'vitest';
import { createPalindrome, createPalindromeList } from './service';
describe('createPalindrome', () => {
test('should create palindrome by reversing the entire string', () => {

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { extractSubstring } from './service';
describe('extractSubstring', () => {

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect } from 'vitest';
import { palindromeList } from './service';
describe('palindromeList', () => {

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { randomizeCase } from './service';
describe('randomizeCase', () => {

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { stringReverser } from './service';
describe('stringReverser', () => {

View File

@@ -2,7 +2,6 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { compute, SplitOperatorType } from './service';
import RadioWithTextField from '../../../components/options/RadioWithTextField';

View File

@@ -2,7 +2,6 @@ import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolTextInput from '../../../components/input/ToolTextInput';
import ToolTextResult from '../../../components/result/ToolTextResult';
import * as Yup from 'yup';
import ToolOptions from '../../../components/options/ToolOptions';
import { compute } from './service';
import TextFieldWithDesc from '../../../components/options/TextFieldWithDesc';

View File

@@ -1,4 +1,4 @@
import { expect, describe, it } from 'vitest';
import { describe, expect, it } from 'vitest';
import { UppercaseInput } from './service';
describe('UppercaseInput', () => {