exercism / exercism/javascript-analyzer

Improve resistor-color-duo: detect string concat

オープン
#55 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
16
フォーク
21
平均マージ
6時間 53分
マージ済み PR(30日)
2

説明

**Describe the improvement**:

When the following main method is provided, the analyzer bails early:

```javascript
export const value = arr => {
return +(COLORS.indexOf(arr[0]) + "" + COLORS.indexOf(arr[1]));
};
```

Instead, it should be caught by `hasDigitsString`, and produce the same comment.

**Which exercise**

`resistor-color-duo`

**Additional context**

The `ResistorColorDuoSolution` has a method that checks if an exercise _has a constructed string_. It currently only detects a string template literal that looks like `${a}${b}`, but we want to also capture the following:

```javascript
`${a}` + `${b}`
a + "" + b
a + '' + b
"" + a + b
'' + a + b
a.toString() + b
a.toString() + b.toString()
a.toString().concat(b)
```

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

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

評価

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

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

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