Skip to content

Commit

Permalink
index.js: simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 28, 2023
1 parent 5c0805c commit 5874601
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5874601

Please sign in to comment.