File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,20 @@ test('inferProperties', function() {
29
29
}
30
30
] ) ;
31
31
32
+ expect (
33
+ evaluate ( '/** @property {number} b */ type a = { b: 1 };' ) . properties
34
+ ) . toEqual ( [
35
+ {
36
+ lineNumber : 0 ,
37
+ name : 'b' ,
38
+ title : 'property' ,
39
+ type : {
40
+ name : 'number' ,
41
+ type : 'NameExpression'
42
+ }
43
+ }
44
+ ] ) ;
45
+
32
46
expect (
33
47
evaluate ( '/** */interface a { b: 1, c: { d: 2 } };' ) . properties
34
48
) . toEqual ( [
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function inferProperties(comment) {
35
35
const explicitProperties = new Set ( ) ;
36
36
// Ensure that explicitly specified properties are not overridden
37
37
// by inferred properties
38
- comment . properties . forEach ( prop => explicitProperties . add ( prop ) ) ;
38
+ comment . properties . forEach ( prop => explicitProperties . add ( prop . name ) ) ;
39
39
40
40
function inferProperties ( value , prefix ) {
41
41
if ( value . type === 'ObjectTypeAnnotation' ) {
You can’t perform that action at this time.
0 commit comments