Boundary condition checks and arguments check is missing
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, react
- 領域
- frontend
調査の方向性
まず、関数の引数が省略されている issue の例を使って、引数が欠落した呼び出しを index.js に対して再現します。既存の引数処理を確認し、無効な入力が報告された警告を生成し、string.replace TypeError が発生しないことを検証してください。issue ではテストファイルは指定されていません。
索引モデルが issue の本文から書いたものです。
説明
Hi, I found some test cases where the function is failing:
reactStringReplace('Apt 111, phone number 555-5555-555.', (match, i) => (
console.log( <span key=${i} style={{ color: 'red' }}>${match})
));
so what I did I removed the second parameter and checked, so function is passed as matched and fn is passed as undefined. And got the below error:
F:\github\test1\react-string-replace\node_modules\react-string-replace\index.js:11
? string.replace(reRegExpChar, '\$&')
^
TypeError: string.replace is not a function
So, I added some validation checks for the arguments so that instead of exiting with an error it provides the user with the warning message and exists swiftly.
PS F:\github\test1\react-string-replace> node app
Debugger attached.
Apt 111, phone number 555-5555-555.
function
undefined
Please check the function arguments, either the match or the function is missing
Waiting for the debugger to disconnect...
thanks,
Niki
Also, I have added the fix in my local system and wanted to check in with you
- 主要言語
- JavaScript
- スター
- 666
- フォーク
- 54
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
iansinnott/react-string-replace のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
iansinnott/react-string-replace#89 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
iansinnott/react-string-replace#64 · コメント 2 件 · リアクション 2 件 ·
-
Capture groups?オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
iansinnott/react-string-replace#58 · コメント 4 件 · リアクション 15 件 ·
iansinnott/react-string-replace の issue をすべて見る
似ている issue
-
feature task
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
RealDevSquad/website-www#1178 ·
-
add latest sol modelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
netlify-labs/nax#56 · コメント 2 件 · リアクション 1 件 ·
-
accessibility bug revealjs
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
quarto-dev/quarto-cli#14961 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
PnX-SI/GeoNature#4435 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
openlayers/openlayers#17648 ·
メンテナーはふだん 1 日以内に返信