Innovenergy_trunk/frontend/node_modules/testcafe/lib/utils/get-options/screenshot.js

19 lines
2.6 KiB
JavaScript

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = __importDefault(require("./base"));
const screenshot_option_names_1 = __importDefault(require("../../configuration/screenshot-option-names"));
function isScreenshotOption(option) {
return Object.values(screenshot_option_names_1.default).includes(option);
}
async function default_1(options) {
const parsedOptions = await (0, base_1.default)(options);
if (typeof options === 'string' && Object.keys(parsedOptions).some(key => !isScreenshotOption(key)))
return { path: options };
return parsedOptions;
}
exports.default = default_1;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NyZWVuc2hvdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy91dGlscy9nZXQtb3B0aW9ucy9zY3JlZW5zaG90LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsa0RBQW9DO0FBQ3BDLDBHQUFrRjtBQUlsRixTQUFTLGtCQUFrQixDQUFFLE1BQWM7SUFDdkMsT0FBTyxNQUFNLENBQUMsTUFBTSxDQUFDLGlDQUF1QixDQUFDLENBQUMsUUFBUSxDQUFDLE1BQWlDLENBQUMsQ0FBQztBQUM5RixDQUFDO0FBRWMsS0FBSyxvQkFBVyxPQUF1RDtJQUNsRixNQUFNLGFBQWEsR0FBRyxNQUFNLElBQUEsY0FBYyxFQUFDLE9BQU8sQ0FBQyxDQUFDO0lBRXBELElBQUksT0FBTyxPQUFPLEtBQUssUUFBUSxJQUFJLE1BQU0sQ0FBQyxJQUFJLENBQUMsYUFBYSxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQyxrQkFBa0IsQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUMvRixPQUF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