Innovenergy_trunk/frontend/node_modules/testcafe/lib/utils/prerender-callsite.js

21 lines
3.3 KiB
JavaScript
Raw Normal View History

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const render_callsite_sync_1 = __importDefault(require("./render-callsite-sync"));
const create_stack_filter_1 = __importDefault(require("../errors/create-stack-filter"));
const get_renderes_1 = __importDefault(require("./get-renderes"));
function prerenderCallsite(callsite) {
const stackFilter = (0, create_stack_filter_1.default)(Error.stackTraceLimit);
const renderers = (0, get_renderes_1.default)(callsite);
return {
prerendered: true,
default: (0, render_callsite_sync_1.default)(callsite, { renderer: renderers.noColor, stackFilter }),
html: (0, render_callsite_sync_1.default)(callsite, { renderer: renderers.html, stackFilter }),
noColor: (0, render_callsite_sync_1.default)(callsite, { renderer: renderers.noColor, stackFilter }),
};
}
exports.default = prerenderCallsite;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJlcmVuZGVyLWNhbGxzaXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL3ByZXJlbmRlci1jYWxsc2l0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUNBLGtGQUF3RDtBQUN4RCx3RkFBOEQ7QUFFOUQsa0VBQTBDO0FBUzFDLFNBQXdCLGlCQUFpQixDQUFFLFFBQW1EO0lBQzFGLE1BQU0sV0FBVyxHQUFHLElBQUEsNkJBQWlCLEVBQUMsS0FBSyxDQUFDLGVBQWUsQ0FBQyxDQUFDO0lBQzdELE1BQU0sU0FBUyxHQUFLLElBQUEsc0JBQVksRUFBQyxRQUFRLENBQUMsQ0FBQztJQUUzQyxPQUFPO1FBQ0gsV0FBVyxFQUFFLElBQUk7UUFFakIsT0FBTyxFQUFFLElBQUEsOEJBQWtCLEVBQUMsUUFBU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