(directory, job)
| 669 | function sdkError(result) { |
| 670 | if (!result || typeof result !== "object") |
| 671 | return; |
| 672 | return result.error || result.error === null ? result.error : undefined; |
| 673 | } |
| 674 | function sdkData(result) { |
| 675 | if (!result || typeof result !== "object") |
| 676 | return result; |
| 677 | return Object.prototype.hasOwnProperty.call(result, "data") ? result.data : result; |
| 678 | } |
| 679 | function sdkErrorMessage(error) { |
| 680 | if (!error) |
| 681 | return "unknown SDK error"; |
| 682 | if (error instanceof Error) |
| 683 | return error.message; |
| 684 | if (typeof error === "string") |
| 685 | return error; |
| 686 | if (typeof error === "object") { |
| 687 | if (typeof error.message === "string") |
| 688 | return error.message; |
no test coverage detected