Skip to content

Commit a6c9bcc

Browse files
queryTypesResolutionPathsFromPackageExports (#25573)
## Description Minor cleanups of queryTypesResolutionPathsFromPackageExports, no functional changes.
1 parent fb102ed commit a6c9bcc

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

build-tools/packages/build-cli/src/library/packageExports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function findTypesPathsMatching<TOutKey>(
155155
* mapNode10CompatExportPathToData, map of compat file path to Node16 path.
156156
*/
157157
export function queryTypesResolutionPathsFromPackageExports<TOutKey>(
158-
packageJson: PackageJson,
158+
packageJson: Pick<PackageJson, "exports">,
159159
mapQueryPathToOutKey: ReadonlyMap<string | RegExp, TOutKey | undefined>,
160160
{
161161
node10TypeCompat,

build-tools/packages/build-cli/src/test/library/packageExports.test.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,11 @@ function assertEquivalentMaps<TKeys, TValues>(
262262
}
263263

264264
describe("library/packageExports", () => {
265-
describe("queryResolutionPathsFromPackageExports", () => {
266-
[
267-
["commonjs (dist path)", "dist", "require"] as const,
268-
["esm (lib path)", "lib", "import"] as const,
269-
// eslint-disable-next-line unicorn/no-array-for-each
270-
].forEach(([desc, path, condition]) =>
265+
describe("queryTypesResolutionPathsFromPackageExports", () => {
266+
for (const [desc, path, condition] of [
267+
["commonjs (dist path)", "dist", "require"],
268+
["esm (lib path)", "lib", "import"],
269+
] as const) {
271270
describe(`using ${desc}`, () => {
272271
const logger = new MockLogger();
273272
beforeEach(() => {
@@ -343,7 +342,7 @@ describe("library/packageExports", () => {
343342
commonNode10CompatExportResults,
344343
);
345344
});
346-
}),
347-
);
345+
});
346+
}
348347
});
349348
});

0 commit comments

Comments
 (0)