| 1 | import { types as tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/, type PluginObjectscip-typescript npm @babel/core 7.20.12 src/config/validation/`plugins.ts`/PluginObject# } from "@babel/core"scip-typescript npm @babel/core 7.20.12 src/`index.ts`/; |
| 2 | import type { NodePathscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath# } from "@babel/traverse"scip-typescript npm @babel/traverse 7.20.13 src/`index.ts`/; |
| 3 | import buildOptimizedSequenceExpressionscip-typescript npm @babel/plugin-proposal-pipeline-operator 7.18.9 src/`buildOptimizedSequenceExpression.ts`/buildOptimizedSequenceExpression. from "./buildOptimizedSequenceExpression"scip-typescript npm @babel/plugin-proposal-pipeline-operator 7.18.9 src/`buildOptimizedSequenceExpression.ts`/; |
| 4 | |
| 5 | const fsharpVisitorscip-typescript npm @babel/plugin-proposal-pipeline-operator 7.18.9 src/`fsharpVisitor.ts`/fsharpVisitor.: PluginObjectscip-typescript npm @babel/core 7.20.12 src/config/validation/`plugins.ts`/PluginObject#["visitor"scip-typescript npm @babel/core 7.20.12 src/config/validation/`plugins.ts`/PluginObject#typeLiteral0:visitor.] = { |
| 6 | BinaryExpression(path) { |
| 7 | const { scopescip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#scope., nodescip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#node. } = path; |
| 8 | const { operatorscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BinaryExpression#operator., leftscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BinaryExpression#left., rightscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BinaryExpression#right. } = node; |
| 9 | if (operator !== "|>") return; |
| 10 | |
| 11 | const placeholder = scope.generateUidIdentifierBasedOnNodescip-typescript npm @babel/traverse 7.20.13 src/scope/`index.ts`/Scope#generateUidIdentifierBasedOnNode().(left); |
| 12 | |
| 13 | const call = |
| 14 | right.typescip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/ArrayExpression#type. === "AwaitExpression" |
| 15 | ? tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.awaitExpressionscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/awaitExpression().(tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.cloneNode(placeholder)) |
| 16 | : tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.callExpressionscip-typescript npm @babel/types 7.20.7 src/builders/generated/`index.ts`/callExpression().(right, [tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.cloneNode(placeholder)]); |
| 17 | const sequence = buildOptimizedSequenceExpressionscip-typescript npm @babel/plugin-proposal-pipeline-operator 7.18.9 src/`buildOptimizedSequenceExpression.ts`/buildOptimizedSequenceExpression.({ |
| 18 | placeholderscip-typescript npm @babel/plugin-proposal-pipeline-operator 7.18.9 src/`buildOptimizedSequenceExpression.ts`/Options#typeLiteral2:placeholder., |
| 19 | callscip-typescript npm @babel/plugin-proposal-pipeline-operator 7.18.9 src/`buildOptimizedSequenceExpression.ts`/Options#typeLiteral2:call., |
| 20 | pathscip-typescript npm @babel/plugin-proposal-pipeline-operator 7.18.9 src/`buildOptimizedSequenceExpression.ts`/Options#typeLiteral2:path.: path as NodePathscip-typescript npm @babel/traverse 7.20.13 src/path/`index.ts`/NodePath#<tscip-typescript npm @babel/types 7.20.7 src/`index.ts`/.BinaryExpressionscip-typescript npm @babel/types 7.20.7 src/ast-types/generated/`index.ts`/BinaryExpression# & { operator: "|>" }>, |
| 21 | }); |
| 22 | path.replaceWithscip-typescript npm @babel/traverse 7.20.13 src/path/`replacement.ts`/replaceWith().(sequence); |
| 23 | }, |
| 24 | }; |
| 25 | |
| 26 | export default fsharpVisitorscip-typescript npm @babel/plugin-proposal-pipeline-operator 7.18.9 src/`fsharpVisitor.ts`/fsharpVisitor.; |