(data: any, withResult: boolean = true)
| 22 | } |
| 23 | |
| 24 | export async function serialize(data: any, withResult: boolean = true){ |
| 25 | if (isNullish(data)) { |
| 26 | return null; |
| 27 | } |
| 28 | if (Array.isArray(data)) { |
| 29 | return Promise.all( data.map(item => item.toJson(withResult))); |
| 30 | } |
| 31 | return data.toJson(withResult); |
| 32 | } |
| 33 | |
| 34 | export function createTaskNotFoundError(taskId: number): JsonHTTPResponseWithMessage { |
| 35 | return new JsonHTTPResponseWithMessage( |
no test coverage detected