From 40906a9a237b3edec0014abc153d7f420e152b5d Mon Sep 17 00:00:00 2001 From: Alec Lomas Date: Wed, 1 May 2019 16:53:22 -0700 Subject: [PATCH] Don't mutate the config object directly --- index.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index a5fdd75..e047a35 100644 --- a/index.js +++ b/index.js @@ -77,6 +77,7 @@ exports.decorateConfig = config => { background-color: ${colors.lightBlack} !important; } `; + const termCSS = ` ${config.termCSS || ''} @@ -104,15 +105,22 @@ exports.decorateConfig = config => { } `; - config.backgroundColor = config.backgroundColor || colors.black; - config.foregroundColor = config.foregroundColor || colors.white; - config.borderColor = config.borderColor || colors.black; - config.cursorAccentColor = config.cursorAccentColor || colors.black; - config.cursorColor = config.cursorColor || colors.red; - config.selectionColor = config.selectionColor || colors.transparentRed; - config.padding = config.padding || '12px 24px'; + const backgroundColor = colors.black; + const foregroundColor = colors.white; + const borderColor = colors.black; + const cursorAccentColor = colors.black; + const cursorColor = colors.red; + const selectionColor = colors.transparentRed; + const padding = '12px 24px'; return Object.assign({}, config, { + backgroundColor, + foregroundColor, + borderColor, + cursorColor, + cursorAccentColor, + selectionColor, + padding, colors, termCSS, css -- 2.51.2