Skip to content

Commit 417aa95

Browse files
perf: ignore mapper if files is empty
1 parent 434619b commit 417aa95

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,11 @@ function initMappers(options: InternalResolverOptions) {
468468
: []),
469469
]
470470

471+
if (files.length === 0) {
472+
// eslint-disable-next-line unicorn/no-useless-undefined
473+
return undefined
474+
}
475+
471476
return {
472477
files: new Set(files.map(toNativePathSeparator)),
473478
mapperFn,

0 commit comments

Comments
 (0)