Skip to content

Commit e3a1213

Browse files
refactor: code
1 parent 401bf91 commit e3a1213

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/index.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -420,20 +420,18 @@ function localizeDeclaration(declaration, context) {
420420
}
421421

422422
module.exports = (options = {}) => {
423-
if (options && options.mode) {
424-
if (
425-
options.mode !== "global" &&
426-
options.mode !== "local" &&
427-
options.mode !== "pure"
428-
) {
429-
throw new Error(
430-
'options.mode must be either "global", "local" or "pure" (default "local")'
431-
);
432-
}
423+
if (
424+
options.mode !== "global" &&
425+
options.mode !== "local" &&
426+
options.mode !== "pure"
427+
) {
428+
throw new Error(
429+
'options.mode must be either "global", "local" or "pure" (default "local")'
430+
);
433431
}
434432

435-
const pureMode = options && options.mode === "pure";
436-
const globalMode = options && options.mode === "global";
433+
const pureMode = options.mode === "pure";
434+
const globalMode = options.mode === "global";
437435

438436
return {
439437
postcssPlugin: "postcss-modules-local-by-default",

0 commit comments

Comments
 (0)