mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-14 06:20:47 +00:00
update
This commit is contained in:
33
node_modules/browser-sync-ui/lib/plugins/remote-debug/compression.js
generated
vendored
Normal file
33
node_modules/browser-sync-ui/lib/plugins/remote-debug/compression.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
var Immutable = require("immutable");
|
||||
|
||||
module.exports.init = function (ui, bs) {
|
||||
|
||||
var optPath = ["remote-debug", "compression"];
|
||||
|
||||
ui.setOptionIn(optPath, Immutable.Map({
|
||||
name: "compression",
|
||||
title: "Compression",
|
||||
active: false,
|
||||
tagline: "Add Gzip Compression to all responses"
|
||||
}));
|
||||
|
||||
var methods = {
|
||||
toggle: function (value) {
|
||||
if (value !== true) {
|
||||
value = false;
|
||||
}
|
||||
if (value) {
|
||||
ui.setOptionIn(optPath.concat("active"), true);
|
||||
bs.addMiddleware("", require("compression")(), {id: "ui-compression", override: true});
|
||||
} else {
|
||||
ui.setOptionIn(optPath.concat("active"), false);
|
||||
bs.removeMiddleware("ui-compression");
|
||||
}
|
||||
},
|
||||
event: function (event) {
|
||||
methods[event.event](event.data);
|
||||
}
|
||||
};
|
||||
|
||||
return methods;
|
||||
};
|
Reference in New Issue
Block a user