alloc / alloc/nebu

[RFC] Node.prototype.wrap

オープン
#11 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
TypeScript
スター
16
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

説明

```js
node.wrap('try {\n', '\n}')
// identical to:
node.before('try {\n')
node.after('\n}')
```
You can wrap the node with anything, but the main use cases are blocks and call expressions.

Do we have a separate method for "block wrapping" that indents the wrapped node and implicitly adds the newline characters seen above? Or maybe passing `true` as the third argument can do that?

```js
node.wrap('try {', '}', true)
// or
node.bwrap('try {', '}')
```

Not a big fan of the name `bwrap` though.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。