* Format a list of tokens into an expression. * e.g. tokens parsed from 'a {{b}} c' can be serialized * into one single expression as '"a " + b + " c"'. * * @param {Array} tokens * @param {Vue} [vm] * @return {String}
(tokens, vm)
| 847 | */ |
| 848 | |
| 849 | function tokensToExp(tokens, vm) { |
| 850 | if (tokens.length > 1) { |
| 851 | return tokens.map(function (token) { |
| 852 | return formatToken(token, vm); |
| 853 | }).join('+'); |
| 854 | } else { |
| 855 | return formatToken(tokens[0], vm, true); |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | /** |
| 860 | * Format a single token. |
no test coverage detected