From 5874601dfacae12ca4fafd965a8cee68c557a28f Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 28 Apr 2023 09:56:41 +0300 Subject: [PATCH] index.js: simplify code --- index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 72298f5..73f1178 100644 --- a/index.js +++ b/index.js @@ -92,12 +92,10 @@ const filterVariables = (sassFilesString, variables) => { const parseOptions = (opts = {}) => { const options = { ...defaultOptions, ...opts }; - if (Boolean(options.ignore) && !Array.isArray(options.ignore)) { - throw new TypeError('`ignore` should be an Array'); - } - - if (Boolean(options.ignoreFiles) && !Array.isArray(options.ignoreFiles)) { - throw new TypeError('`ignoreFiles` should be an Array'); + for (const option of ['ignore', 'ignoreFiles']) { + if (!Array.isArray(options[option])) { + throw new TypeError(`\`${option}\` should be an Array`); + } } // Trim list of ignored variables