1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2025-07-06 09:09:04 +02:00
RaspAP/node_modules/browser-sync/dist/cli/transforms/handleGhostModeOption.js
2018-03-09 02:03:53 +00:00

53 lines
1.5 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
function handleGhostModeOption(incoming) {
var value = incoming.get('ghostMode');
var trueAll = {
clicks: true,
scroll: true,
forms: {
submit: true,
inputs: true,
toggles: true
}
};
var falseAll = {
clicks: false,
scroll: false,
forms: {
submit: false,
inputs: false,
toggles: false
}
};
if (value === false ||
value === "false") {
return incoming.set('ghostMode', immutable_1.fromJS(falseAll));
}
if (value === true ||
value === "true") {
return incoming.set('ghostMode', immutable_1.fromJS(trueAll));
}
if (value.get("forms") === false) {
return incoming.set('ghostMode', value.withMutations(function (map) {
map.set("forms", immutable_1.fromJS({
submit: false,
inputs: false,
toggles: false
}));
}));
}
if (value.get("forms") === true) {
return incoming.set('ghostMode', value.withMutations(function (map) {
map.set("forms", immutable_1.fromJS({
submit: true,
inputs: true,
toggles: true
}));
}));
}
return incoming;
}
exports.handleGhostModeOption = handleGhostModeOption;
//# sourceMappingURL=handleGhostModeOption.js.map