UNPKG

e2ed

Version:

E2E testing framework over Playwright

18 lines (17 loc) 529 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getBodyAsString = void 0; /** * Get request or response body as string by original body. * @internal */ const getBodyAsString = (originalBody, isBodyInJsonFormat) => { if (originalBody === undefined) { return ''; } if (typeof originalBody === 'string') { return originalBody; } return isBodyInJsonFormat ? JSON.stringify(originalBody) : String(originalBody); }; exports.getBodyAsString = getBodyAsString;