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() {
2929 }
3030 ] ) ;
3131
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+
3246 expect (
3347 evaluate ( '/** */interface a { b: 1, c: { d: 2 } };' ) . properties
3448 ) . toEqual ( [
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function inferProperties(comment) {
3535 const explicitProperties = new Set ( ) ;
3636 // Ensure that explicitly specified properties are not overridden
3737 // by inferred properties
38- comment . properties . forEach ( prop => explicitProperties . add ( prop ) ) ;
38+ comment . properties . forEach ( prop => explicitProperties . add ( prop . name ) ) ;
3939
4040 function inferProperties ( value , prefix ) {
4141 if ( value . type === 'ObjectTypeAnnotation' ) {
You can’t perform that action at this time.
0 commit comments