mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-24 02:13:43 +03:00
Preclude kitchen configs from mutation
This commit is contained in:
parent
b77f0c85e9
commit
df09b7e0ec
|
@ -12,8 +12,7 @@
|
|||
const ifIncontinence = 'if-incontinence';
|
||||
const modsKey = 'mods';
|
||||
|
||||
// Don't keep objects in defaults or at least freeze them!
|
||||
const configs = {
|
||||
const getDefaultConfigs () => {// Configs user may mutate them and we don't care!
|
||||
|
||||
ifProxyHttpsUrlsOnly: {
|
||||
dflt: false,
|
||||
|
@ -93,6 +92,7 @@
|
|||
|
||||
const getDefaults = function getDefaults() {
|
||||
|
||||
const configs = getDefaultConfigs();
|
||||
return Object.keys(configs).reduce((acc, key) => {
|
||||
|
||||
acc[key] = configs[key].dflt;
|
||||
|
@ -123,6 +123,7 @@
|
|||
const getOrderedConfigsForUser = function getOrderedConfigs(category) {
|
||||
|
||||
const pacMods = getCurrentConfigs();
|
||||
const configs = getDefaultConfigs();
|
||||
return Object.keys(configs)
|
||||
.sort((keyA, keyB) => configs[keyA].order - configs[keyB].order)
|
||||
.reduce((arr, key) => {
|
||||
|
@ -144,6 +145,7 @@
|
|||
const createPacModifiers = function createPacModifiers(mods = {}) {
|
||||
|
||||
mods = mods || {}; // null?
|
||||
const configs = getDefaultConfigs();
|
||||
const ifNoMods = Object.keys(configs)
|
||||
.every((dProp) => {
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user