MCPcopy Index your code
hub / github.com/omkarcloud/botasaurus / validateAndGetTaskId

Function validateAndGetTaskId

js/botasaurus-server-js/src/validation.ts:314–329  ·  view source on GitHub ↗
(id: any, propertyName: string = "Task id")

Source from the content-addressed store, hash-verified

312}
313
314export function validateAndGetTaskId(id: any, propertyName: string = "Task id"): number {
315 if (isNullish(id)) {
316 throw new JsonHTTPResponseWithMessage(`${propertyName} must be provided`)
317 }
318
319 if (isStringOfAtLeast1Len(id)) {
320 const idStr = isObject(id) ? JSON.stringify(id) : id;
321 id = tryIntConversion(id, `${propertyName} '${idStr}' is invalid.`);
322
323 }
324
325
326 validateTaskId(id, propertyName)
327
328 return id;
329}
330
331
332function validateTaskId(id: any, propertyName: string ) {

Callers 8

getTaskFunction · 0.90
getTaskResultsFunction · 0.90
downloadTaskResultsFunction · 0.90
abortSingleTaskFunction · 0.90
deleteSingleTaskFunction · 0.90
retrySingleTaskFunction · 0.90
getUiTaskResultsFunction · 0.90
validateMaxTasksParamFunction · 0.85

Calls 5

isNullishFunction · 0.90
isObjectFunction · 0.90
isStringOfAtLeast1LenFunction · 0.85
tryIntConversionFunction · 0.85
validateTaskIdFunction · 0.85

Tested by

no test coverage detected