MCPcopy
hub / github.com/callumalpass/tasknotes / copyTaskInfo

Function copyTaskInfo

src/api/TaskNotesAPI.ts:3457–3498  ·  view source on GitHub ↗
(task: TaskInfo)

Source from the content-addressed store, hash-verified

3455}
3456
3457function copyTaskInfo(task: TaskInfo): TaskInfo {
3458 const copy = { ...task };
3459
3460 if (task.tags) {
3461 copy.tags = [...task.tags];
3462 }
3463 if (task.contexts) {
3464 copy.contexts = [...task.contexts];
3465 }
3466 if (task.projects) {
3467 copy.projects = [...task.projects];
3468 }
3469 if (task.complete_instances) {
3470 copy.complete_instances = [...task.complete_instances];
3471 }
3472 if (task.skipped_instances) {
3473 copy.skipped_instances = [...task.skipped_instances];
3474 }
3475 if (task.icsEventId) {
3476 copy.icsEventId = [...task.icsEventId];
3477 }
3478 if (task.googleCalendarMovedOriginalDates) {
3479 copy.googleCalendarMovedOriginalDates = [...task.googleCalendarMovedOriginalDates];
3480 }
3481 if (task.reminders) {
3482 copy.reminders = task.reminders.map((reminder) => ({ ...reminder }));
3483 }
3484 if (task.timeEntries) {
3485 copy.timeEntries = task.timeEntries.map((entry) => ({ ...entry }));
3486 }
3487 if (task.blockedBy) {
3488 copy.blockedBy = task.blockedBy.map((dependency) => ({ ...dependency }));
3489 }
3490 if (task.blocking) {
3491 copy.blocking = [...task.blocking];
3492 }
3493 if (task.customProperties) {
3494 copy.customProperties = { ...task.customProperties };
3495 }
3496
3497 return copy;
3498}

Callers 15

getTaskMethod · 0.85
getTaskDependenciesMethod · 0.85
getTaskRelationshipsMethod · 0.85
createTaskMethod · 0.85
updateTaskMethod · 0.85
completeTaskMethod · 0.85
rescheduleTaskMethod · 0.85
archiveTaskMethod · 0.85
moveTaskMethod · 0.85
uncompleteTaskMethod · 0.85
setTaskPropertyMethod · 0.85
startTimeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected