MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / serialize

Function serialize

js/botasaurus-server-js/src/validation.ts:24–32  ·  view source on GitHub ↗
(data: any, withResult: boolean = true)

Source from the content-addressed store, hash-verified

22}
23
24export 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
34export function createTaskNotFoundError(taskId: number): JsonHTTPResponseWithMessage {
35 return new JsonHTTPResponseWithMessage(

Callers 4

performCreateAllTaskFunction · 0.90
performCreateTasksFunction · 0.90
getTaskFromDbFunction · 0.90
refetchTasksFunction · 0.90

Calls 2

isNullishFunction · 0.90
toJsonMethod · 0.45

Tested by

no test coverage detected