e2ed
Version:
E2E testing framework over Playwright
18 lines (17 loc) • 589 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getReplacedFields = void 0;
const maxFieldsCount = 1_000;
/**
* Get array of replaced fields of object for `replaceFields` function.
* @internal
*/
const getReplacedFields = (value) => {
const fields = value instanceof Error ? Object.getOwnPropertyNames(value) : Object.keys(value);
fields.push(...Object.getOwnPropertySymbols(value));
if (fields.length > maxFieldsCount) {
fields.length = maxFieldsCount;
}
return fields;
};
exports.getReplacedFields = getReplacedFields;