From fb6dd816a1ae7df69482107a867903ac842dfd4a Mon Sep 17 00:00:00 2001 From: AshAnand34 Date: Mon, 7 Jul 2025 22:07:46 -0700 Subject: [PATCH] refactor: simplify initial values handling and remove unused types in Crontab Guru tool --- src/pages/tools/time/crontab-guru/index.tsx | 5 +++-- src/pages/tools/time/crontab-guru/service.ts | 3 +-- src/pages/tools/time/crontab-guru/types.ts | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 src/pages/tools/time/crontab-guru/types.ts diff --git a/src/pages/tools/time/crontab-guru/index.tsx b/src/pages/tools/time/crontab-guru/index.tsx index 20033c3..d5785db 100644 --- a/src/pages/tools/time/crontab-guru/index.tsx +++ b/src/pages/tools/time/crontab-guru/index.tsx @@ -7,9 +7,10 @@ import ToolTextResult from '@components/result/ToolTextResult'; import { GetGroupsType } from '@components/options/ToolOptions'; import { CardExampleType } from '@components/examples/ToolExamples'; import { main, validateCrontab, explainCrontab } from './service'; -import { InitialValuesType } from './types'; -const initialValues: InitialValuesType = {}; +const initialValues = {}; + +type InitialValuesType = typeof initialValues; const exampleCards: CardExampleType[] = [ { diff --git a/src/pages/tools/time/crontab-guru/service.ts b/src/pages/tools/time/crontab-guru/service.ts index 1c81ba8..638636c 100644 --- a/src/pages/tools/time/crontab-guru/service.ts +++ b/src/pages/tools/time/crontab-guru/service.ts @@ -1,4 +1,3 @@ -import { InitialValuesType } from './types'; import cronstrue from 'cronstrue'; import { isValidCron } from 'cron-validator'; @@ -14,7 +13,7 @@ export function validateCrontab(expr: string): boolean { return isValidCron(expr, { seconds: false, allowBlankDay: true }); } -export function main(input: string, options: InitialValuesType): string { +export function main(input: string, _options: any): string { if (!input.trim()) return ''; if (!validateCrontab(input)) { return 'Invalid crontab expression.'; diff --git a/src/pages/tools/time/crontab-guru/types.ts b/src/pages/tools/time/crontab-guru/types.ts deleted file mode 100644 index 54b3d7e..0000000 --- a/src/pages/tools/time/crontab-guru/types.ts +++ /dev/null @@ -1,4 +0,0 @@ -// Options for crontab-guru tool. Currently empty, but can be extended for advanced features. -export type InitialValuesType = { - // Add future options here -};