Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion www/lib/package/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,22 @@ function normalizeExports(
let result: Record<string, string> = {};
for (let [key, value] of Object.entries(exports)) {
let resolved = resolveExportValue(value);
if (resolved) {
if (resolved && isDocumentable(resolved)) {
result[key] = resolved;
}
}

return Object.keys(result).length > 0 ? result : { ".": "./src/index.ts" };
}

/**
* Check if an export path points to a documentable source file.
* Filters out binary artifacts like .wasm files that can't be parsed as TypeScript/JavaScript.
*/
function isDocumentable(path: string): boolean {
return !path.endsWith(".wasm");
}

/**
* Sanitize a semver version range for use in npm: specifiers.
* Handles cases like "^3 || ^4" by taking the first valid part.
Expand Down
Loading