Fix single-digit integer parse (!)

This commit is contained in:
Tom Russell 2018-09-30 21:53:20 +01:00
parent 79724cc449
commit 45d6a8e6e5

View File

@ -8,7 +8,7 @@
* @param {string} value * @param {string} value
*/ */
function strictParseInt(value) { function strictParseInt(value) {
if (/^([1-9][0-9]+)$/.test(value)) if (/^([1-9][0-9]*)$/.test(value))
return Number(value); return Number(value);
return NaN; return NaN;
} }