Function
addElementToArrayLiteral
(
arr: ts.ArrayLiteralExpression,
elem: ts.Expression,
)
Source from the content-addressed store, hash-verified
| 192 | * Given an existing array literal expression, update it by pushing a new expression. |
| 193 | */ |
| 194 | export function addElementToArrayLiteral( |
| 195 | arr: ts.ArrayLiteralExpression, |
| 196 | elem: ts.Expression, |
| 197 | ): ts.ArrayLiteralExpression { |
| 198 | return ts.factory.updateArrayLiteralExpression(arr, [...arr.elements, elem]); |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Given an ObjectLiteralExpression node, extract and return the PropertyAssignment corresponding to |
Tested by
no test coverage detected