File tree Expand file tree Collapse file tree 4 files changed +4
-12
lines changed
tests/baselines/reference/api Expand file tree Collapse file tree 4 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -858,6 +858,7 @@ namespace ts {
858
858
name ?: PropertyName ;
859
859
}
860
860
861
+ /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
861
862
export type ObjectLiteralElementLike
862
863
= PropertyAssignment
863
864
| ShorthandPropertyAssignment
Original file line number Diff line number Diff line change @@ -6632,18 +6632,7 @@ namespace ts {
6632
6632
}
6633
6633
6634
6634
export function isObjectLiteralElement ( node : Node ) : node is ObjectLiteralElement {
6635
- switch ( node . kind ) {
6636
- case SyntaxKind . JsxAttribute :
6637
- case SyntaxKind . JsxSpreadAttribute :
6638
- case SyntaxKind . PropertyAssignment :
6639
- case SyntaxKind . ShorthandPropertyAssignment :
6640
- case SyntaxKind . MethodDeclaration :
6641
- case SyntaxKind . GetAccessor :
6642
- case SyntaxKind . SetAccessor :
6643
- return true ;
6644
- default :
6645
- return false ;
6646
- }
6635
+ return node . kind === SyntaxKind . JsxAttribute || node . kind === SyntaxKind . JsxSpreadAttribute || isObjectLiteralElementLike ( node ) ;
6647
6636
}
6648
6637
6649
6638
/* @internal */
Original file line number Diff line number Diff line change @@ -616,6 +616,7 @@ declare namespace ts {
616
616
_objectLiteralBrandBrand : any ;
617
617
name ?: PropertyName ;
618
618
}
619
+ /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
619
620
type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration ;
620
621
interface PropertyAssignment extends ObjectLiteralElement , JSDocContainer {
621
622
parent : ObjectLiteralExpression ;
Original file line number Diff line number Diff line change @@ -616,6 +616,7 @@ declare namespace ts {
616
616
_objectLiteralBrandBrand : any ;
617
617
name ?: PropertyName ;
618
618
}
619
+ /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */
619
620
type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration ;
620
621
interface PropertyAssignment extends ObjectLiteralElement , JSDocContainer {
621
622
parent : ObjectLiteralExpression ;
You can’t perform that action at this time.
0 commit comments