mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-13 19:42:38 +05:30
refactor: simplify initial values handling and remove unused types in Crontab Guru tool
This commit is contained in:
parent
a613bdb4c5
commit
fb6dd816a1
3 changed files with 4 additions and 8 deletions
|
|
@ -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>[] = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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.';
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue