Closed AyumuTakai closed 3 years ago
replace.tsのreplace()メソッドにReplaceRuleの空配列を渡すと、利用しているhast-util-find-and-replace/index.js内でpair[0]のような形で要素があることを前提にしているため以下のエラーが発生します。
TypeError: Cannot read property '0' of undefined
空配列の場合には置換処理をスキップしてしまったほうが良いと思います。
マージありがとうございます。これでCLIのほうの記述が少しシンプルになります。
こちらこそ、PR ありがとうございました!
replace.tsのreplace()メソッドにReplaceRuleの空配列を渡すと、利用しているhast-util-find-and-replace/index.js内でpair[0]のような形で要素があることを前提にしているため以下のエラーが発生します。
空配列の場合には置換処理をスキップしてしまったほうが良いと思います。