@@ -17,9 +17,6 @@ function isParenthesized(node: NGNode) {
1717function getOuterStart ( node : NGNode ) : number {
1818 return isParenthesized ( node ) ? node . extra . parenStart : node . start ! ;
1919}
20- function getOuterEnd ( node : NGNode ) : number {
21- return isParenthesized ( node ) ? node . extra . parenEnd : node . end ! ;
22- }
2320
2421function isOptionalObjectOrCallee ( node : NGNode ) : boolean {
2522 if ( node . type === 'TSNonNullExpression' && ! isParenthesized ( node ) ) {
@@ -275,20 +272,15 @@ class Transformer extends Source {
275272
276273 if ( node instanceof angular . LiteralMap ) {
277274 const { keys, values } = node ;
278- const tValues = values . map ( ( value ) =>
279- this . transform < babel . Expression > ( value , childTransformOptions ) ,
280- ) ;
281275 const tProperties = keys . map ( ( property , index ) => {
282276 const { key, quoted } = property ;
283- const tValue = tValues [ index ] ;
284- const valueStart = getOuterStart ( tValue ) ;
285- const valueEnd = getOuterEnd ( tValue ) ;
277+ const { start : valueStart , end : valueEnd } = values [ index ] . sourceSpan ;
286278
287279 const keyStart = this . getCharacterIndex (
288280 / \S / ,
289281 index === 0
290282 ? node . sourceSpan . start + 1 // {
291- : this . getCharacterIndex ( ',' , getOuterEnd ( tValues [ index - 1 ] ) ) + 1 ,
283+ : this . getCharacterIndex ( ',' , values [ index - 1 ] . sourceSpan . end ) + 1 ,
292284 ) ;
293285 const keyEnd =
294286 valueStart === keyStart
@@ -316,12 +308,16 @@ class Transformer extends Source {
316308 [ ] ,
317309 ) ;
318310 const shorthand = tKey . end < tKey . start || keyStart === valueStart ;
311+ const value = this . transform < babel . Expression > (
312+ values [ index ] ,
313+ childTransformOptions ,
314+ ) ;
319315
320316 return this . #create< babel . ObjectProperty > (
321317 {
322318 type : 'ObjectProperty' ,
323319 key : tKey ,
324- value : tValue ,
320+ value,
325321 shorthand,
326322 computed : false ,
327323 start : getOuterStart ( tKey ) ,
0 commit comments