Skip to content

Commit a0f559f

Browse files
committed
chore: Simplify logic
1 parent 521af9c commit a0f559f

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

src/plugin.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,24 +122,18 @@ export default class DocgenPlugin {
122122
// eslint-disable-next-line
123123
// @ts-ignore
124124
const { module } = parser.state;
125+
const nameForCondition = module.nameForCondition();
125126

126-
if (!module.rawRequest) {
127+
if (isExcluded(nameForCondition)) {
127128
debugExclude(
128-
`Ignoring module without "rawRequest": ${module.userRequest}`
129+
`Module not matched in "exclude": ${nameForCondition}`
129130
);
130131
return;
131132
}
132133

133-
if (isExcluded(module.userRequest)) {
134+
if (!isIncluded(nameForCondition)) {
134135
debugExclude(
135-
`Module not matched in "exclude": ${module.userRequest}`
136-
);
137-
return;
138-
}
139-
140-
if (!isIncluded(module.userRequest)) {
141-
debugExclude(
142-
`Module not matched in "include": ${module.userRequest}`
136+
`Module not matched in "include": ${nameForCondition}`
143137
);
144138
return;
145139
}

0 commit comments

Comments
 (0)