UNPKG

@stevescruz/task-master

Version:

A command-line todo list that allows you to write your tasks, set priorities, view existing tasks and view the next tasks due.

25 lines (22 loc) 668 B
class Task { constructor({ id, description, status, timestamp, age, priority, tag }) { if (!id) { throw new Error('To register a task you must provide a valid id.') } if (!description) { throw new Error('To register a task you must provide a valid description.') } this.id = id; this.description = description; this.status = status || 'pending'; this.timestamp = timestamp || new Date(); this.priority = priority || 'N'; if (tag) { this.tag = tag; } if (age) { this.age = age; } } } module.exports = Task;