Skip to content

Commit 8e08d9b

Browse files
committed
feat: use resolve.types
1 parent 22b1539 commit 8e08d9b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/get-package-types.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { exports } from "@es-joy/resolve.exports";
1+
import { types as resolveTypes } from "@es-joy/resolve.exports";
22
import { goTry } from "go-go-try";
33
import type { NormalizedPackageJson } from "read-pkg";
44

@@ -34,11 +34,7 @@ function getExportsMapTypes({
3434
// Try to resolve the `exports` map in `package.json`
3535
// with conditions `import` and `types` enabled to find
3636
// a valid TypeScript type definitions file.
37-
const [err, entries = []] = goTry(() =>
38-
exports(pkgJson, subpath, {
39-
conditions: ["!default", "!node", "import", "types"],
40-
}),
41-
);
37+
const [err, entries = []] = goTry(() => resolveTypes(pkgJson, subpath));
4238

4339
// The package may not have an `exports` map.
4440
if (err !== undefined) return undefined;

0 commit comments

Comments
 (0)