Skip to content

Commit 5874601

Browse files
committed
index.js: simplify code
1 parent 5c0805c commit 5874601

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,10 @@ const filterVariables = (sassFilesString, variables) => {
9292
const parseOptions = (opts = {}) => {
9393
const options = { ...defaultOptions, ...opts };
9494

95-
if (Boolean(options.ignore) && !Array.isArray(options.ignore)) {
96-
throw new TypeError('`ignore` should be an Array');
97-
}
98-
99-
if (Boolean(options.ignoreFiles) && !Array.isArray(options.ignoreFiles)) {
100-
throw new TypeError('`ignoreFiles` should be an Array');
95+
for (const option of ['ignore', 'ignoreFiles']) {
96+
if (!Array.isArray(options[option])) {
97+
throw new TypeError(`\`${option}\` should be an Array`);
98+
}
10199
}
102100

103101
// Trim list of ignored variables

0 commit comments

Comments
 (0)