(id: any, propertyName: string = "Task id")
| 312 | } |
| 313 | |
| 314 | export 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 | |
| 332 | function validateTaskId(id: any, propertyName: string ) { |
no test coverage detected