Skip to content

Commit 2a3e4ce

Browse files
fix: removed unused method
1 parent a4a497f commit 2a3e4ce

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/NodeParser/PromiseNodeParser.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -95,32 +95,4 @@ export class PromiseNodeParser implements SubNodeParser {
9595

9696
return node.name?.getText();
9797
}
98-
99-
/**
100-
* If specified node extends Promise or PromiseLike and nothing else then this method returns the
101-
* array item type. In all other cases null is returned to indicate that the node is not a simple promise.
102-
*
103-
* @param node - The interface or class to check.
104-
* @return The promise item type if node is an promise, null otherwise.
105-
*/
106-
protected getPromiseItemType(node: ts.InterfaceDeclaration | ts.ClassDeclaration): ts.TypeNode | null {
107-
if (node.heritageClauses && node.heritageClauses.length === 1) {
108-
const clause = node.heritageClauses[0];
109-
110-
if (clause.types.length === 1) {
111-
const type = clause.types[0];
112-
const symbol = this.typeChecker.getSymbolAtLocation(type.expression);
113-
114-
if (symbol && (symbol.name === "Promise" || symbol.name === "PromiseLike")) {
115-
const typeArguments = type.typeArguments;
116-
117-
if (typeArguments?.length === 1) {
118-
return typeArguments[0];
119-
}
120-
}
121-
}
122-
}
123-
124-
return null;
125-
}
12698
}

0 commit comments

Comments
 (0)