refactor: simplify initial values handling and remove unused types in Crontab Guru tool

This commit is contained in:
AshAnand34
2025-07-07 22:07:46 -07:00
parent a613bdb4c5
commit fb6dd816a1
3 changed files with 4 additions and 8 deletions

View File

@@ -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<InitialValuesType>[] = [
{

View File

@@ -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.';

View File

@@ -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
};