Skip to content

Commit 2298d24

Browse files
committedAug 22, 2024·
chore: fix types
1 parent c7435f0 commit 2298d24

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"openapi-typescript": "^7.3.0",
150150
"pathe": "^1.1.2",
151151
"perfect-debounce": "^1.0.0",
152-
"pkg-types": "^1.1.3",
152+
"pkg-types": "^1.2.0",
153153
"pretty-bytes": "^6.1.1",
154154
"radix3": "^1.1.2",
155155
"rollup": "^4.21.0",

‎pnpm-lock.yaml

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/rollup/plugins/externals.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -483,18 +483,22 @@ function compareVersions(v1 = "0.0.0", v2 = "0.0.0") {
483483
}
484484

485485
export function applyProductionCondition(exports: PackageJson["exports"]) {
486-
if (!exports || typeof exports === "string") {
486+
if (
487+
!exports ||
488+
typeof exports === "string" ||
489+
Array.isArray(exports) /* TODO: unhandled */
490+
) {
487491
return;
488492
}
489-
if (exports.production) {
493+
if ("production" in exports) {
490494
if (typeof exports.production === "string") {
491495
exports.default = exports.production;
492496
} else {
493497
Object.assign(exports, exports.production);
494498
}
495499
}
496500
for (const key in exports) {
497-
applyProductionCondition(exports[key]);
501+
applyProductionCondition(exports[key as keyof typeof exports]);
498502
}
499503
}
500504

0 commit comments

Comments
 (0)
Please sign in to comment.