Skip to content

Commit 3fa8d10

Browse files
fix: handle more types with NodeJS prefix
2 parents 0dc77b3 + 59ff615 commit 3fa8d10

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

generate-types/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,13 @@ const printError = (diagnostic) => {
841841
/** @type {ts.TypeNode} */
842842
let typeNode = /** @type {any} */ (type)._typeNode;
843843
if (type.aliasSymbol) {
844+
const fullEscapedName = getFullEscapedName(type.aliasSymbol);
845+
if (fullEscapedName.includes("NodeJS.")) {
846+
return {
847+
type: "primitive",
848+
name: fullEscapedName,
849+
};
850+
}
844851
const aliasType = checker.getDeclaredTypeOfSymbol(type.aliasSymbol);
845852
if (aliasType && aliasType !== type) {
846853
const typeArguments = type.aliasTypeArguments || [];

0 commit comments

Comments
 (0)