Skip to content

Commit 043c6f4

Browse files
committed
remove unused hasTypeProp
1 parent 00606d2 commit 043c6f4

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

packages/helpers/lib/class/explorer.ts

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -875,59 +875,6 @@ class Explorer {
875875
return result;
876876
}
877877

878-
// Checks if a property with the given name (and optionally type and optionality) exists in the current tree, which can be an interface, type literal, or variable statement with a type literal annotation
879-
hasTypeProp(name: string, type?: string, isOptional?: boolean): boolean {
880-
if (!this.tree) {
881-
return false;
882-
}
883-
884-
const members = findMembers(this.tree);
885-
886-
if (!members) {
887-
return false;
888-
}
889-
890-
const member = members.find((m) => {
891-
if (m.name && isIdentifier(m.name)) {
892-
return m.name.text === name;
893-
}
894-
895-
return false;
896-
});
897-
898-
if (!member) {
899-
return false;
900-
}
901-
902-
// Check type if specified
903-
if (type !== undefined) {
904-
if (isPropertySignature(member)) {
905-
if (!member.type) {
906-
return false;
907-
}
908-
909-
const memberType = new Explorer(member.type);
910-
if (!memberType.matches(new Explorer(type, "typeReference"))) {
911-
return false;
912-
}
913-
} else {
914-
return false;
915-
}
916-
}
917-
918-
// Check optionality if specified
919-
if (isOptional !== undefined) {
920-
if (isPropertySignature(member)) {
921-
const memberIsOptional = member.questionToken !== undefined;
922-
if (memberIsOptional !== isOptional) {
923-
return false;
924-
}
925-
}
926-
}
927-
928-
return true;
929-
}
930-
931878
// Checks if all specified properties exist in the current tree, which can be an interface, type alias, type literal, or variable statement with a type literal annotation
932879
hasTypeProps(props: TypeProp | TypeProp[]): boolean {
933880
if (!this.tree) {

0 commit comments

Comments
 (0)