(
{value}: LiteralElement,
isInPlural: boolean,
isFirstEl: boolean,
isLastEl: boolean
)
| 128 | } |
| 129 | |
| 130 | function printLiteralElement( |
| 131 | {value}: LiteralElement, |
| 132 | isInPlural: boolean, |
| 133 | isFirstEl: boolean, |
| 134 | isLastEl: boolean |
| 135 | ) { |
| 136 | let escaped = value |
| 137 | // If this literal starts with a ' and its not the 1st node, this means the node before it is non-literal |
| 138 | // and the `'` needs to be unescaped |
| 139 | if (!isFirstEl && escaped[0] === `'`) { |
| 140 | escaped = `''${escaped.slice(1)}` |
| 141 | } |
| 142 | // Same logic but for last el |
| 143 | if (!isLastEl && escaped[escaped.length - 1] === `'`) { |
| 144 | escaped = `${escaped.slice(0, escaped.length - 1)}''` |
| 145 | } |
| 146 | return printEscapedMessage(escaped, isInPlural) |
| 147 | } |
| 148 | |
| 149 | function printArgumentElement({value}: ArgumentElement) { |
| 150 | return `{${value}}` |
no test coverage detected