Comparing version
@@ -5,2 +5,4 @@ import { ScheduledTask, TaskFn, TaskOptions } from "./tasks/scheduled-task"; | ||
export declare function validate(expression: string): boolean; | ||
export declare const getTasks: () => Map<string, ScheduledTask>; | ||
export declare const getTask: (taskId: string) => ScheduledTask | undefined; | ||
export { ScheduledTask } from './tasks/scheduled-task'; | ||
@@ -12,4 +14,6 @@ export type { TaskFn, TaskContext, TaskOptions } from './tasks/scheduled-task'; | ||
validate: typeof validate; | ||
getTasks: typeof getTasks; | ||
getTask: typeof getTask; | ||
} | ||
export declare const nodeCron: NodeCron; | ||
export default nodeCron; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.nodeCron = void 0; | ||
exports.nodeCron = exports.getTask = exports.getTasks = void 0; | ||
exports.schedule = schedule; | ||
@@ -58,8 +58,12 @@ exports.createTask = createTask; | ||
} | ||
exports.getTasks = registry.all; | ||
exports.getTask = registry.get; | ||
exports.nodeCron = { | ||
schedule, | ||
createTask, | ||
validate | ||
validate, | ||
getTasks: exports.getTasks, | ||
getTask: exports.getTask, | ||
}; | ||
exports.default = exports.nodeCron; | ||
//# sourceMappingURL=node-cron.js.map |
import { ScheduledTask } from "./tasks/scheduled-task"; | ||
declare const tasks: Map<string, ScheduledTask>; | ||
export declare class TaskRegistry { | ||
@@ -6,5 +7,6 @@ add(task: ScheduledTask): void; | ||
remove(task: ScheduledTask): void; | ||
all(): ScheduledTask[]; | ||
all(): typeof tasks; | ||
has(taskId: string): boolean; | ||
killAll(): void; | ||
} | ||
export {}; |
@@ -25,3 +25,3 @@ "use strict"; | ||
all() { | ||
return Array.from(tasks.values()); | ||
return tasks; | ||
} | ||
@@ -32,3 +32,3 @@ has(taskId) { | ||
killAll() { | ||
this.all().forEach(id => this.remove(id)); | ||
tasks.forEach(id => this.remove(id)); | ||
} | ||
@@ -35,0 +35,0 @@ } |
@@ -5,2 +5,4 @@ import { ScheduledTask, TaskFn, TaskOptions } from "./tasks/scheduled-task"; | ||
export declare function validate(expression: string): boolean; | ||
export declare const getTasks: () => Map<string, ScheduledTask>; | ||
export declare const getTask: (taskId: string) => ScheduledTask | undefined; | ||
export { ScheduledTask } from './tasks/scheduled-task'; | ||
@@ -12,4 +14,6 @@ export type { TaskFn, TaskContext, TaskOptions } from './tasks/scheduled-task'; | ||
validate: typeof validate; | ||
getTasks: typeof getTasks; | ||
getTask: typeof getTask; | ||
} | ||
export declare const nodeCron: NodeCron; | ||
export default nodeCron; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.nodeCron = void 0; | ||
exports.nodeCron = exports.getTask = exports.getTasks = void 0; | ||
exports.schedule = schedule; | ||
@@ -58,8 +58,12 @@ exports.createTask = createTask; | ||
} | ||
exports.getTasks = registry.all; | ||
exports.getTask = registry.get; | ||
exports.nodeCron = { | ||
schedule, | ||
createTask, | ||
validate | ||
validate, | ||
getTasks: exports.getTasks, | ||
getTask: exports.getTask, | ||
}; | ||
exports.default = exports.nodeCron; | ||
//# sourceMappingURL=node-cron.js.map |
import { ScheduledTask } from "./tasks/scheduled-task"; | ||
declare const tasks: Map<string, ScheduledTask>; | ||
export declare class TaskRegistry { | ||
@@ -6,5 +7,6 @@ add(task: ScheduledTask): void; | ||
remove(task: ScheduledTask): void; | ||
all(): ScheduledTask[]; | ||
all(): typeof tasks; | ||
has(taskId: string): boolean; | ||
killAll(): void; | ||
} | ||
export {}; |
@@ -25,3 +25,3 @@ "use strict"; | ||
all() { | ||
return Array.from(tasks.values()); | ||
return tasks; | ||
} | ||
@@ -32,3 +32,3 @@ has(taskId) { | ||
killAll() { | ||
this.all().forEach(id => this.remove(id)); | ||
tasks.forEach(id => this.remove(id)); | ||
} | ||
@@ -35,0 +35,0 @@ } |
{ | ||
"name": "node-cron", | ||
"version": "4.1.1", | ||
"version": "4.2.0", | ||
"description": "A Lightweight Task Scheduler for Node.js", | ||
@@ -5,0 +5,0 @@ "author": "Lucas Merencia", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
219594
0.43%3181
0.63%