Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"components": {},
"name": "CronValidationService",
"description": "Service for validating 6-field cron expressions with extended features.\n\nThis service handles cron validation logic for extended cron expression formats\nthat support additional features beyond standard Unix cron for more flexible\nscheduling capabilities.\n\nFormat: minutes hours day-of-month month day-of-week year\n\nKey Features:\n- Wildcards: asterisk (any value), question mark (any value for day fields)\n- Ranges: 1-5, MON-FRI, JAN-MAR\n- Steps: asterisk/15, 5/10, 1-5/2\n- Lists: 1,3,5, MON,WED,FRI\n- Special chars: L (last), W (weekday), hash (nth occurrence)",
"methods": {
"description": "Methods used in service.",
"values": [
{
"name": "isValidCron",
"parameters": [
{
"name": "cron",
"type": "string",
"description": "The 6-field cron expression to validate"
},
{
"name": "allowEmpty",
"type": "boolean",
"description": "Whether to allow empty cron expressions",
"defaultValue": "false"
}
],
"returnType": "boolean",
"description": "Validates a complete 6-field cron expression."
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Injectable } from '@angular/core';
* - Lists: 1,3,5, MON,WED,FRI
* - Special chars: L (last), W (weekday), hash (nth occurrence)
* @see {@link https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html#cron-based | AWS EventBridge Scheduler - Cron-based schedules}
* @group Services
*/
@Injectable({
providedIn: 'root'
Expand All @@ -27,6 +28,7 @@ export class CronValidationService {
* @param cron - The 6-field cron expression to validate
* @param allowEmpty - Whether to allow empty cron expressions
* @returns boolean - True if the cron expression is valid
* @group Method
*/
isValidCron(cron: string, allowEmpty = false): boolean {
if (typeof cron !== 'string') return false;
Expand Down
Loading