@@ -838,8 +838,8 @@ export class TypeParser {
838
838
) : ConstExprStringNode | IdentifierTypeNode {
839
839
const startLine = tokens . currentTokenLine ( ) ;
840
840
const startIndex = tokens . currentTokenIndex ( ) ;
841
-
842
841
let key : ConstExprStringNode | IdentifierTypeNode ;
842
+
843
843
if ( tokens . isCurrentTokenType ( Lexer . TOKEN_SINGLE_QUOTED_STRING ) ) {
844
844
if ( this . quoteAwareConstExprString ) {
845
845
key = new QuoteAwareConstExprStringNode (
@@ -848,12 +848,11 @@ export class TypeParser {
848
848
) ;
849
849
} else {
850
850
key = new ConstExprStringNode (
851
- tokens . currentTokenValue ( ) . replace ( / ( ^ " | " $ ) / g, '' ) ,
851
+ tokens . currentTokenValue ( ) . replace ( / ( ^ ' | ' $ ) / g, '' ) ,
852
852
) ;
853
853
}
854
854
tokens . next ( ) ;
855
- }
856
- if ( tokens . isCurrentTokenType ( Lexer . TOKEN_DOUBLE_QUOTED_STRING ) ) {
855
+ } else if ( tokens . isCurrentTokenType ( Lexer . TOKEN_DOUBLE_QUOTED_STRING ) ) {
857
856
if ( this . quoteAwareConstExprString ) {
858
857
key = new QuoteAwareConstExprStringNode (
859
858
StringUnescaper . unescapeString ( tokens . currentTokenValue ( ) ) ,
@@ -864,12 +863,12 @@ export class TypeParser {
864
863
tokens . currentTokenValue ( ) . replace ( / ( ^ " | " $ ) / g, '' ) ,
865
864
) ;
866
865
}
867
-
868
866
tokens . next ( ) ;
869
867
} else {
870
868
key = new IdentifierTypeNode ( tokens . currentTokenValue ( ) ) ;
871
869
tokens . consumeTokenType ( Lexer . TOKEN_IDENTIFIER ) ;
872
870
}
871
+
873
872
return this . enrichWithAttributes ( tokens , key , startLine , startIndex ) ;
874
873
}
875
874
}
0 commit comments