Skip to content

Commit 485c5e5

Browse files
Improved npm build script
1 parent ef01701 commit 485c5e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/npm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ const keywords = readme.map((s) => s.match(/^\!\[(.*)\]\((.*)\)$/))
2020

2121
const entryPoints = [];
2222
let types: string | undefined;
23-
const typed: { [s: string]: string[] } = {};
23+
let typed: { [s: string]: string[] } | null = null;
2424
for (const [name, path] of Object.entries(denoJson.exports)) {
2525
const d = path.replace(/^(\.\/)?(.*)(\.[^.]+)$/i, './esm/$2.d$3');
2626
if (name === '.') {
2727
entryPoints.unshift(path);
2828
types = d;
2929
} else {
3030
entryPoints.push({ name, path });
31-
typed[name.replace(/^\.\//, '')] = [d];
31+
(typed ??= {})[name.replace(/^\.\//, '')] = [d];
3232
}
3333
}
3434

0 commit comments

Comments
 (0)