Boundary condition checks and arguments check is missing
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, react
- Ambito
- frontend
Direzione di ricerca
Inizia riproducendo la chiamata con l'argomento mancante verso index.js, usando l'esempio nell'issue in cui l'argomento della funzione viene omesso. Controlla la gestione esistente degli argomenti e verifica che gli input non validi producano l'avviso segnalato senza il string.replace TypeError; l'issue non indica alcun file di test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- JavaScript
- Stelle
- 666
- Fork
- 54
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di iansinnott/react-string-replace
-
not a replacement functionAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
iansinnott/react-string-replace#89 · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
iansinnott/react-string-replace#64 · 2 commenti · 2 reazioni ·
-
Capture groups?Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
iansinnott/react-string-replace#58 · 4 commenti · 15 reazioni ·
Tutte le issue di iansinnott/react-string-replace
Issue simili
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
stac-utils/stac-fields#42 ·
-
[sec-check] SVG remote-reference gate misses src attributes, link hrefs and bare-string @importApertaagent/security hive/hosted-available-lke648397-260827-5n31 security
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Fix #3381 does not fix #3343: watch() returns the ref, not the value, so setup() never re-runsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Add: Eurosport 1 PolskaApertachannels:add check:passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
I maintainer di solito rispondono entro 2 giorni