UNPKG

e2ed

Version:

E2E testing framework over Playwright

16 lines (15 loc) 556 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.truncateArrayForLogs = void 0; const internal_1 = require("../../constants/internal"); /** * Truncate a long array for a short printout. * @internal */ const truncateArrayForLogs = (array) => { if (array.length <= internal_1.MAX_ELEMENTS_COUNT_IN_PRINTED_ARRAY) { return array; } return { firstElements: array.slice(0, internal_1.MAX_ELEMENTS_COUNT_IN_PRINTED_ARRAY), length: array.length }; }; exports.truncateArrayForLogs = truncateArrayForLogs;