(path)
| 399 | } |
| 400 | }, |
| 401 | ObjectExpression(path) { |
| 402 | // Replace objects with {instancePath} with a string corresponding |
| 403 | // to the `instancePath`, or `instancePath` and `message` combined. |
| 404 | const {properties} = path.node; |
| 405 | const instancePath = findProperty(properties, 'instancePath'); |
| 406 | if (!instancePath) { |
| 407 | return; |
| 408 | } |
| 409 | const message = findProperty(properties, 'message'); |
| 410 | if (!message) { |
| 411 | path.replaceWith(instancePath.value); |
| 412 | return; |
| 413 | } |
| 414 | path.replaceWith(template.expression.ast` |
| 415 | (${instancePath.value} + ' ' + ${message.value}).trim() |
| 416 | `); |
| 417 | }, |
| 418 | ObjectPattern(path) { |
| 419 | // Replace destructuring of arguments with {instancePath} with just |
| 420 | // the assignment or id for instancePath |
nothing calls this directly
no test coverage detected