* Returns parsed string. * @param {Expression} expression expression * @returns {string} parsed string
(expression)
| 4862 | * @returns {string} parsed string |
| 4863 | */ |
| 4864 | parseString(expression) { |
| 4865 | switch (expression.type) { |
| 4866 | case "BinaryExpression": |
| 4867 | if (expression.operator === "+") { |
| 4868 | return ( |
| 4869 | this.parseString(/** @type {Expression} */ (expression.left)) + |
| 4870 | this.parseString(expression.right) |
| 4871 | ); |
| 4872 | } |
| 4873 | break; |
| 4874 | case "Literal": |
| 4875 | return String(expression.value); |
| 4876 | } |
| 4877 | throw new Error( |
| 4878 | `${expression.type} is not supported as parameter for require` |
| 4879 | ); |
| 4880 | } |
| 4881 | |
| 4882 | /** @typedef {{ range?: Range, value: string, code: boolean, conditional: false | CalculatedStringResult[] }} CalculatedStringResult */ |
| 4883 |
no outgoing calls
no test coverage detected