(path)
| 416 | `); |
| 417 | }, |
| 418 | ObjectPattern(path) { |
| 419 | // Replace destructuring of arguments with {instancePath} with just |
| 420 | // the assignment or id for instancePath |
| 421 | const replacedPath = path.parentPath.isAssignmentPattern() |
| 422 | ? path.parentPath |
| 423 | : path; |
| 424 | if (!replacedPath.parentPath.isFunctionDeclaration()) { |
| 425 | return; |
| 426 | } |
| 427 | const {properties} = path.node; |
| 428 | const value = findProperty(properties, 'instancePath')?.value; |
| 429 | if (t.isIdentifier(value) || t.isAssignmentPattern(value)) { |
| 430 | replacedPath.replaceWith(value); |
| 431 | } |
| 432 | }, |
| 433 | }, |
| 434 | }; |
| 435 | const result = babel.transformSync(code, { |
nothing calls this directly
no test coverage detected