Skip to content

Commit

Permalink
pipe operator: Add topicToken: ^ (caret) option (#2575)
Browse files Browse the repository at this point in the history
  • Loading branch information
js-choi committed Oct 29, 2021
1 parent 2ff76bc commit 75401be
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/plugin-proposal-pipeline-operator.md
Expand Up @@ -22,7 +22,7 @@ Configure which proposal to use with the required `"proposal"` option.
| `"hack"` | [Hack-style pipes](https://github.com/js-choi/proposal-hack-pipes) | `v7.15.0`
| ~~`"smart"`~~ | [Smart-mix pipes](https://github.com/js-choi/proposal-smart-pipelines) (deprecated) | `v7.3.0`

If `"proposal": "hack"` is used, then a `"topicToken": "%"` or `"topicToken": "#"` option must also be included.
If `"proposal": "hack"` is used, then a `"topicToken": "%"`, `"topicToken": "^"`, or `"topicToken": "#"` option must also be included.

The `"proposal": "smart"` option is deprecated and subject to removal in a future major version.

Expand Down Expand Up @@ -284,7 +284,6 @@ For [F# pipes with `await`](https://github.com/valtech-nyc/proposal-fsharp-pipel
]
}
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `%` topic token:

```json
Expand All @@ -295,6 +294,16 @@ For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `%` topic
}
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `^` topic token:

```json
{
"plugins": [
["@babel/plugin-proposal-pipeline-operator", { "proposal": "hack", "topicToken": "^" }]
]
}
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `#` topic token:

```json
Expand Down Expand Up @@ -341,6 +350,16 @@ require("@babel/core").transformSync("code", {
});
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `^` topic token:

```javascript
require("@babel/core").transformSync("code", {
plugins: [
[ "@babel/plugin-proposal-pipeline-operator", { proposal: "hack", topicToken: "^" } ],
],
});
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `#` topic token:

```javascript
Expand Down

0 comments on commit 75401be

Please sign in to comment.