Skip to content

Commit 3d09583

Browse files
committed
fix: fix type check logic
2 parents d5d9f26 + 7c0582c commit 3d09583

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/type-check.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function checkOptions(target: Options, varName: string = 'Options') {
55
if (typeof target.include !== 'function' && !Array.isArray(target.include)) {
66
throw new TypeError(`${varName}.include must be a function or an array`);
77
}
8-
if (typeof target.exclude === 'function' && !Array.isArray(target.exclude)) {
8+
if (typeof target.exclude !== 'function' && !Array.isArray(target.exclude)) {
99
throw new TypeError(`${varName}.exclude must be a function or an array`);
1010
}
1111
checkFileContentSpecifier(target.content, `${varName}.content`);
@@ -29,7 +29,7 @@ export function checkFileContentSetterReturnValue(
2929
throw new TypeError(
3030
`SourceDescription returned by ${varName} must have a code property of type string`
3131
);
32-
} else {
32+
} else if (typeof target !== 'string') {
3333
throw new TypeError(`${varName} must return a string or an object`);
3434
}
3535
}

0 commit comments

Comments
 (0)