From ba961e8ad39a31834ff20b73392612ae6b13ecaa Mon Sep 17 00:00:00 2001 From: Evilebot Tnawi Date: Wed, 29 May 2019 17:41:56 +0300 Subject: [PATCH] fix: use toString on properties in replaceSymbols (#63) --- src/replaceSymbols.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/replaceSymbols.js b/src/replaceSymbols.js index 9e53448..c12ecc1 100644 --- a/src/replaceSymbols.js +++ b/src/replaceSymbols.js @@ -3,15 +3,18 @@ import replaceValueSymbols from "./replaceValueSymbols.js"; const replaceSymbols = (css, replacements) => { css.walk(node => { if (node.type === "decl" && node.value) { - node.value = replaceValueSymbols(node.value, replacements); + node.value = replaceValueSymbols(node.value.toString(), replacements); } else if (node.type === "rule" && node.selector) { - node.selector = replaceValueSymbols(node.selector, replacements); + node.selector = replaceValueSymbols( + node.selector.toString(), + replacements + ); } else if ( node.type === "atrule" && node.params && ["media", "supports"].includes(node.name.toLowerCase()) ) { - node.params = replaceValueSymbols(node.params, replacements); + node.params = replaceValueSymbols(node.params.toString(), replacements); } }); };