import { EventSchema } from '../index' ; import { EventGenerator } from '../../src/apis/event/EventGenerator' ; export function norm ( myRecent ) { const transFns = [ firstOfARecurrentEvent ] ; return myRecent . map ( ( x ) => transFns . reduce ( ( y , f ) => f ( y ) , x ) ) ; } function firstOfARecurrentEvent ( recent ) { if ( ! recent . recurrence || ! recent . recurrence . length || recent . type === 'task' ) { return recent ; } const egen = new EventGenerator ( recent ) ; return egen . next ( ) . value ; } export const myRecent = [ { "_id" : "5698933d78eaa265030f9c37" , "_tasklistId" : "56989110644284a37be3ba7b" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "attachments" : [ ] , "uniqueId" : 2 , "_sourceId" : "5698933d78eaa265030f9c37" , "recurrence" : [ "RRULE:FREQ=DAILY;DTSTART=20170209T010000Z;INTERVAL=1" ] , "sourceDate" : "2017-02-09T01:00:00.000Z" , "pos" : 851968 , "customfields" : [ { "type" : "number" , "_customfieldId" : "5848e3800df120d6d2259ea2" , "values" : [ "222" ] } , { "type" : "dropDown" , "_customfieldId" : "589c500d53c164ca52390808" , "values" : [ "589c500d53c164ca5239080b" ] } , { "type" : "multipleChoice" , "_customfieldId" : "589c503b53c164ca52390810" , "values" : [ "589c503b53c164ca52390813" , "589c503b53c164ca52390812" ] } , { "type" : "date" , "_customfieldId" : "589c5042bdcdc8c4526f441b" , "values" : [ "2017-02-21T16:15:00.000Z" ] } , { "type" : "text" , "_customfieldId" : "589c504953c164ca52390817" , "values" : [ "阿萨德撒" ] } ] , "tagIds" : [ ] , "_stageId" : "56989110644284a37be3ba7c" , "visible" : "members" , "subtaskIds" : [ "569c5f533b92767224153c8f" ] , "involveMembers" : [ "56986d43542ce1a2798c8cfb" , "55c0496b266e692f55d50239" ] , "updated" : "2017-02-09T11:26:29.248Z" , "created" : "2016-01-15T06:35:41.829Z" , "isArchived" : null , "isDeleted" : false , "isDone" : false , "source" : "teambition" , "priority" : 0 , "dueDate" : null , "startDate" : "2017-02-09T01:00:00.000Z" , "accomplished" : null , "note" : "" , "content" : "看护者卡尔古玛" , "url" : "http://project.ci/project/56988fb705ead4ae7bb8dcfe/tasks/scrum/56989110644284a37be3ba7b/task/5698933d78eaa265030f9c37" , "type" : "task" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : null , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "573c3434c809de876f19bd4f" , "_tasklistId" : "56989110644284a37be3ba7b" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "attachments" : [ ] , "uniqueId" : 135 , "pos" : 1572864 , "customfields" : [ ] , "tagIds" : [ ] , "_stageId" : "56989110644284a37be3ba7d" , "visible" : "members" , "subtaskIds" : [ "58410346e74e743a1758f0c2" , "58410347e74e743a1758f0c9" , "58410348c850f03f1737449a" , "58410349e74e743a1758f0d0" , "5841034ac850f03f173744a1" , "5841034be74e743a1758f0d7" , "5841034cc850f03f173744a8" , "5841034ee74e743a1758f0de" ] , "involveMembers" : [ "56986d43542ce1a2798c8cfb" ] , "updated" : "2016-08-24T05:01:23.719Z" , "created" : "2016-05-18T09:21:56.379Z" , "isArchived" : null , "isDeleted" : false , "isDone" : false , "source" : "teambition" , "priority" : 0 , "dueDate" : "2016-05-19T10:00:00.000Z" , "startDate" : null , "accomplished" : null , "note" : "" , "content" : "as long as you love me 8" , "url" : "http://project.ci/project/56988fb705ead4ae7bb8dcfe/tasks/scrum/56989110644284a37be3ba7b/task/573c3434c809de876f19bd4f" , "type" : "task" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : null , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "573c3437dc7658916f7b108f" , "_tasklistId" : "56989110644284a37be3ba7b" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "_creatorId" : "55c02018fd0360a44c93ff97" , "attachments" : [ ] , "uniqueId" : 136 , "pos" : 196608 , "customfields" : [ ] , "tagIds" : [ ] , "_stageId" : "56989110644284a37be3ba7c" , "visible" : "members" , "subtaskIds" : [ ] , "involveMembers" : [ "55c02018fd0360a44c93ff97" , "56986d43542ce1a2798c8cfb" ] , "updated" : "2016-05-18T09:23:28.205Z" , "created" : "2016-05-18T09:21:59.826Z" , "isArchived" : null , "isDeleted" : false , "isDone" : false , "source" : "teambition" , "priority" : 0 , "dueDate" : "2016-05-18T16:00:00.000Z" , "startDate" : null , "accomplished" : null , "note" : "" , "content" : "我是团长谁敢动我1" , "url" : "http://project.ci/project/56988fb705ead4ae7bb8dcfe/tasks/scrum/56989110644284a37be3ba7b/task/573c3437dc7658916f7b108f" , "type" : "task" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : null , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "573c343edc7658916f7b1099" , "_tasklistId" : "56c2c2f0b54938e05b6b2238" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "attachments" : [ ] , "uniqueId" : 139 , "pos" : 327680 , "customfields" : [ ] , "tagIds" : [ ] , "_stageId" : "56c2c2f0b54938e05b6b2239" , "visible" : "members" , "subtaskIds" : [ "57451d12efb0858c38c98938" , "57451d14efb0858c38c9893e" , "57451d206df7654b428dbbf9" , "57451d26efb0858c38c98945" , "57451d28efb0858c38c9894b" , "57451d346df7654b428dbc11" , "57451d386df7654b428dbc17" , "57451d3befb0858c38c98960" , "57451d3e6df7654b428dbc1d" , "57451d43efb0858c38c98966" , "57451d476df7654b428dbc23" , "57451d4aefb0858c38c9896c" , "57451d4c6df7654b428dbc29" , "57451d4eefb0858c38c98972" ] , "involveMembers" : [ "56986d43542ce1a2798c8cfb" ] , "updated" : "2016-08-01T09:40:03.018Z" , "created" : "2016-05-18T09:22:06.886Z" , "isArchived" : null , "isDeleted" : false , "isDone" : false , "source" : "teambition" , "priority" : 0 , "dueDate" : "2016-05-19T10:00:00.000Z" , "startDate" : null , "accomplished" : null , "note" : "" , "content" : "Teambition" , "url" : "http://project.ci/project/56988fb705ead4ae7bb8dcfe/tasks/scrum/56c2c2f0b54938e05b6b2238/task/573c343edc7658916f7b1099" , "type" : "task" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : null , "objectlinksCount" : 4 , "isFavorite" : false } , { "_id" : "57fdd0a82544b1aa19077182" , "uniqueId" : 226 , "_tasklistId" : "56989110644284a37be3ba7b" , "_creatorId" : "5109f1e918e6fcfc560001a6" , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "_executorId" : "56986d43542ce1a2798c8cfb" , "recurrence" : [ "RRULE:FREQ=WEEKLY;DTSTART=20160120T032100Z;INTERVAL=1" ] , "_sourceId" : "569efd3aebfd61da458063c2" , "sourceDate" : "2016-02-17T03:21:00.000Z" , "pos" : 917504 , "customfields" : [ ] , "tagIds" : [ ] , "_stageId" : "56989110644284a37be3ba7c" , "visible" : "members" , "subtaskIds" : [ "57fdd0a92544b1aa1907718c" , "57fdd0a92544b1aa1907718d" , "58410403e74e743a1758f10c" , "58410404e74e743a1758f123" ] , "involveMembers" : [ "56986d43542ce1a2798c8cfb" , "55cc51e01886b6e601b8e398" , "55c0600c37ac6cf05ac4f2e6" , "55c2cb103d2425325e8403af" , "5109f1e918e6fcfc560001a6" ] , "updated" : "2016-10-13T08:13:06.028Z" , "created" : "2016-10-12T05:56:56.887Z" , "isArchived" : null , "isDeleted" : false , "isDone" : false , "source" : "teambition" , "priority" : 1 , "dueDate" : "2016-02-17T03:21:00.000Z" , "startDate" : null , "accomplished" : null , "note" : "test1" , "content" : "et1" , "url" : "http://project.ci/project/56988fb705ead4ae7bb8dcfe/tasks/scrum/56989110644284a37be3ba7b/task/57fdd0a82544b1aa19077182" , "type" : "task" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : null , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "5841729b1548501c664fb73d" , "_tasklistId" : "5841729a1548501c664fb733" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "584172991548501c664fb6e2" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "pos" : 65536 , "customfields" : [ ] , "tagIds" : [ ] , "_stageId" : "5841729a1548501c664fb738" , "visible" : "members" , "subtaskIds" : [ "58453e9f5848062e9387fbc8" , "58453ea05848062e9387fc1d" , "58453ea05848062e9387fc76" , "58453ea197d4b8b15486d2dd" , "58453ea25848062e9387fccf" ] , "involveMembers" : [ "56986d43542ce1a2798c8cfb" , "55c02018fd0360a44c93ff97" , "57429b35c11a046427110c61" , "55c9c566e2cfcae54237a609" , "55c9c548e2cfcae54237a5dc" , "55c9c56be2cfcae54237a612" , "5731bce9e93a7a07086435c6" , "55c9c56ee2cfcae54237a61b" , "5743c04910c15c9a64d2b306" , "55c0492f3dfd04cd5302ca06" , "5693784cfc77cddb27655c5d" , "57037100ef3e6c061d84ac70" , "55c9674c89d19004317e282c" , "569ee653f87e2d3e6ece85b8" , "55c1dde695dfce165ac41372" , "57ad89d90add8b24078fd8a0" , "572feedce93a7a07086435a8" , "55f3f3e71cfbf2945d067389" , "57bbb5c17f68f2dc6f9d30d3" , "55c060be2944cfe95e75a088" , "55f684cf1cfbf2945d0673a0" ] , "updated" : "2016-12-02T13:09:47.170Z" , "created" : "2016-12-02T13:09:47.170Z" , "isArchived" : null , "isDeleted" : false , "isDone" : false , "source" : "teambition" , "priority" : 0 , "dueDate" : "2016-10-12T13:09:47.115Z" , "startDate" : null , "accomplished" : null , "note" : "" , "content" : "task contentf72a618c" , "url" : "http://project.ci/project/584172991548501c664fb6e2/tasks/scrum/5841729a1548501c664fb733/task/5841729b1548501c664fb73d" , "type" : "task" , "project" : { "_id" : "584172991548501c664fb6e2" , "name" : "MidasProject cd446fef" , "isArchived" : false } , "task" : null , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "5841729b8e75da1166e3c627" , "_tasklistId" : "5841729a1548501c664fb733" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "584172991548501c664fb6e2" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "pos" : 65536 , "customfields" : [ ] , "tagIds" : [ ] , "_stageId" : "5841729a1548501c664fb737" , "visible" : "members" , "subtaskIds" : [ ] , "involveMembers" : [ "56986d43542ce1a2798c8cfb" , "55c02018fd0360a44c93ff97" , "57429b35c11a046427110c61" , "55c9c566e2cfcae54237a609" , "55c9c548e2cfcae54237a5dc" , "55c9c56be2cfcae54237a612" , "5731bce9e93a7a07086435c6" , "55c9c56ee2cfcae54237a61b" , "5743c04910c15c9a64d2b306" , "55c0492f3dfd04cd5302ca06" , "5693784cfc77cddb27655c5d" , "57037100ef3e6c061d84ac70" , "55c9674c89d19004317e282c" , "569ee653f87e2d3e6ece85b8" , "55c1dde695dfce165ac41372" , "57ad89d90add8b24078fd8a0" , "572feedce93a7a07086435a8" , "55f3f3e71cfbf2945d067389" , "57bbb5c17f68f2dc6f9d30d3" , "55c060be2944cfe95e75a088" , "55f684cf1cfbf2945d0673a0" ] , "updated" : "2016-12-02T13:09:47.225Z" , "created" : "2016-12-02T13:09:47.225Z" , "isArchived" : null , "isDeleted" : false , "isDone" : false , "source" : "teambition" , "priority" : 0 , "dueDate" : "2016-10-13T13:09:47.159Z" , "startDate" : null , "accomplished" : null , "note" : "" , "content" : "task content4ca4d51a" , "url" : "http://project.ci/project/584172991548501c664fb6e2/tasks/scrum/5841729a1548501c664fb733/task/5841729b8e75da1166e3c627" , "type" : "task" , "project" : { "_id" : "584172991548501c664fb6e2" , "name" : "MidasProject cd446fef" , "isArchived" : false } , "task" : null , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "5841729b8e75da1166e3c68a" , "_tasklistId" : "5841729a1548501c664fb733" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "584172991548501c664fb6e2" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "pos" : 131072 , "customfields" : [ ] , "tagIds" : [ ] , "_stageId" : "5841729a1548501c664fb738" , "visible" : "members" , "subtaskIds" : [ "58453e965848062e9387fb12" , "58453e9797d4b8b15486d1cc" , "58453e9897d4b8b15486d223" , "58453e995848062e9387fb6d" , "58453e9a97d4b8b15486d27c" ] , "involveMembers" : [ "56986d43542ce1a2798c8cfb" , "55c02018fd0360a44c93ff97" , "57429b35c11a046427110c61" , "55c9c566e2cfcae54237a609" , "55c9c548e2cfcae54237a5dc" , "55c9c56be2cfcae54237a612" , "5731bce9e93a7a07086435c6" , "55c9c56ee2cfcae54237a61b" , "5743c04910c15c9a64d2b306" , "55c0492f3dfd04cd5302ca06" , "5693784cfc77cddb27655c5d" , "57037100ef3e6c061d84ac70" , "55c9674c89d19004317e282c" , "569ee653f87e2d3e6ece85b8" , "55c1dde695dfce165ac41372" , "57ad89d90add8b24078fd8a0" , "572feedce93a7a07086435a8" , "55f3f3e71cfbf2945d067389" , "57bbb5c17f68f2dc6f9d30d3" , "55c060be2944cfe95e75a088" , "55f684cf1cfbf2945d0673a0" ] , "updated" : "2016-12-02T13:09:47.838Z" , "created" : "2016-12-02T13:09:47.838Z" , "isArchived" : null , "isDeleted" : false , "isDone" : false , "source" : "teambition" , "priority" : 0 , "dueDate" : "2016-10-14T13:09:47.221Z" , "startDate" : null , "accomplished" : null , "note" : "" , "content" : "task content7e188db8" , "url" : "http://project.ci/project/584172991548501c664fb6e2/tasks/scrum/5841729a1548501c664fb733/task/5841729b8e75da1166e3c68a" , "type" : "task" , "project" : { "_id" : "584172991548501c664fb6e2" , "name" : "MidasProject cd446fef" , "isArchived" : false } , "task" : null , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "56a8a2b71fc624581b13119f" , "_taskId" : "56a5d76333756a5822d9cfa8" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "updated" : "2016-01-27T10:57:59.653Z" , "created" : "2016-01-27T10:57:59.653Z" , "dueDate" : "2016-01-27T10:00:00.000Z" , "content" : "sdasdas" , "isDone" : false , "type" : "subtask" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : { "_id" : "56a5d76333756a5822d9cfa8" , "content" : "sadassd" } , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "56a8a2b993aa35f40d981ebe" , "_taskId" : "56a5d76333756a5822d9cfa8" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "updated" : "2016-01-27T10:58:01.873Z" , "created" : "2016-01-27T10:58:01.873Z" , "dueDate" : "2016-01-27T10:00:00.000Z" , "content" : "dasdasdsasa" , "isDone" : false , "type" : "subtask" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : { "_id" : "56a5d76333756a5822d9cfa8" , "content" : "sadassd" } , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "56a8a2ba93aa35f40d981ec1" , "_taskId" : "56a5d76333756a5822d9cfa8" , "_executorId" : "56986d43542ce1a2798c8cfb" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "updated" : "2016-01-27T10:58:02.685Z" , "created" : "2016-01-27T10:58:02.685Z" , "dueDate" : "2016-01-27T10:00:00.000Z" , "content" : "sdasdasd" , "isDone" : false , "type" : "subtask" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : { "_id" : "56a5d76333756a5822d9cfa8" , "content" : "sadassd" } , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "579032e89cee05e759cb2e61" , "sourceDate" : "2016-07-21T02:00:00.000Z" , "_sourceId" : "579032e89cee05e759cb2e61" , "startDate" : "2016-07-21T02:00:00.000Z" , "endDate" : "2016-07-21T03:00:00.000Z" , "recurrence" : [ "RRULE:FREQ=DAILY;DTSTART=20160721T020000Z;INTERVAL=1;UNTIL=20161212T020000Z" , "EXDATE:20160721T020000Z,20160722T020000Z,20160728T020000Z,20160803T020000Z,20160811T020000Z,20160812T020000Z,20160819T020000Z,20161021T020000Z,20161025T020000Z,20161026T020000Z,20161027T020000Z,20161104T020000Z,20161105T020000Z,20161107T020000Z,20161108T020000Z,20161109T020000Z,20161213T020000Z" ] , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "untilDate" : "2016-12-12T02:00:00.000Z" , "tagIds" : [ ] , "updated" : "2016-12-14T01:44:12.482Z" , "created" : "2016-07-21T02:26:48.892Z" , "isDeleted" : false , "visible" : "members" , "isArchived" : null , "reminders" : [ ] , "involveMembers" : [ "55cc51e01886b6e601b8e398" , "56986d43542ce1a2798c8cfb" , "55f684cf1cfbf2945d0673a0" , "56419b6be9b736f7148f19f8" , "55c02075283447b14c263fe8" ] , "location" : "" , "content" : "修改重复日程内容1" , "title" : "重复日程1号" , "url" : "http://project.ci/project/56988fb705ead4ae7bb8dcfe/events/event/579032e89cee05e759cb2e61" , "type" : "event" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : null , "objectlinksCount" : 1 , "isFavorite" : false } , { "_id" : "57908acb6e81482e0c9e74cb" , "sourceDate" : "2016-07-21T08:00:00.000Z" , "_sourceId" : "57908acb6e81482e0c9e74cb" , "startDate" : "2016-07-21T08:00:00.000Z" , "endDate" : "2016-07-21T09:00:00.000Z" , "recurrence" : [ "RRULE:FREQ=WEEKLY;DTSTART=20160721T080000Z;INTERVAL=1;UNTIL=20161020T080000Z" , "EXDATE:20160728T080000Z,20160811T080000Z" ] , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "untilDate" : "2016-10-20T08:00:00.000Z" , "tagIds" : [ ] , "updated" : "2016-10-27T02:59:58.996Z" , "created" : "2016-07-21T08:41:47.331Z" , "isDeleted" : false , "visible" : "members" , "isArchived" : null , "reminders" : [ ] , "involveMembers" : [ "56986d43542ce1a2798c8cfb" ] , "location" : "" , "content" : "" , "title" : "重复日程2号" , "url" : "http://project.ci/project/56988fb705ead4ae7bb8dcfe/events/event/57908acb6e81482e0c9e74cb" , "type" : "event" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : null , "objectlinksCount" : 0 , "isFavorite" : false } , { "_id" : "57908b116e81482e0c9e74e9" , "sourceDate" : "2016-07-21T08:00:00.000Z" , "_sourceId" : "57908b116e81482e0c9e74e9" , "startDate" : "2016-07-21T08:00:00.000Z" , "endDate" : "2016-07-21T09:00:00.000Z" , "recurrence" : [ "RRULE:FREQ=MONTHLY;DTSTART=20160721T080000Z;INTERVAL=1" , "EXDATE:20161021T080000Z" ] , "_projectId" : "56988fb705ead4ae7bb8dcfe" , "_creatorId" : "56986d43542ce1a2798c8cfb" , "tagIds" : [ ] , "updated" : "2016-10-21T09:08:22.292Z" , "created" : "2016-07-21T08:42:57.981Z" , "isDeleted" : false , "visible" : "members" , "isArchived" : null , "reminders" : [ ] , "involveMembers" : [ "56986d43542ce1a2798c8cfb" ] , "location" : "" , "content" : "" , "title" : "每月重复" , "url" : "http://project.ci/project/56988fb705ead4ae7bb8dcfe/events/event/57908b116e81482e0c9e74e9" , "type" : "event" , "project" : { "_id" : "56988fb705ead4ae7bb8dcfe" , "name" : "谁敢收保护费 !" , "isArchived" : false } , "task" : null , "objectlinksCount" : 0 , "isFavorite" : false } ] . map ( r => { if ( r . type !== 'subtask' ) { delete ( r as any ) . task ; } if ( ( r as any ) . attachments ) { delete ( r as any ) . attachments ; } if ( r . type === 'subtask' ) { delete ( r as any ) . objectlinksCount ; delete ( r as any ) . isFavorite ; } if ( r . type === 'event' ) { delete ( r as any ) . untilDate ; } return r ; } ) ; export const count = { organizationsCount : 1 , notesCount : 20 , reportCount : 10 , favoritesCount : 30 , tasksCount : 160 , subtasksCount : 19 } ;