Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var misc = module.exports;
- function Tasks() {};
- Tasks.prototype = new Array();
- Tasks.prototype.findTask = function(task_id) {
- if (task_id.task_id) {
- task_id = task_id.task_id;
- }
- else if (task_id.id) {
- task_id = task_id.id;
- }
- var found = this.filter(function(task) {return task.task._id == task_id});
- if (found.length > 0) {
- return found[0];
- }
- }
- Tasks.prototype.toJSON = function() {
- return this.slice(0);
- }
- misc.Tasks = Tasks;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement