Skip to content

Commit d9fa6d7

Browse files
committed
optimize getPropertyOfType for unambiguous names
1 parent 1151630 commit d9fa6d7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

util/type.ts

+2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ export function isBooleanLiteralType(type: ts.Type, literal: boolean) {
174174
}
175175

176176
export function getPropertyOfType(type: ts.Type, name: ts.__String) {
177+
if (!(<string>name).startsWith('__'))
178+
return type.getProperty(<string>name);
177179
return type.getProperties().find((s) => s.escapedName === name);
178180
}
179181

0 commit comments

Comments
 (0)