Skip to content

Commit

Permalink
use startsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Jun 17, 2024
1 parent ac50a34 commit e63d61b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function parseNumeric(numericString, userParsingOptions) {
*/
while (processingString !== '') {
if (numbers.includes(processingString.charAt(0)) ||
(processingString.charAt(0) === '.' &&
(processingString.startsWith('.') &&
processingString.length > 1 &&
numbers.includes(processingString.charAt(1)))) {
break;
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function parseNumeric(
while (processingString !== '') {
if (
numbers.includes(processingString.charAt(0)) ||
(processingString.charAt(0) === '.' &&
(processingString.startsWith('.') &&
processingString.length > 1 &&
numbers.includes(processingString.charAt(1)))
) {
Expand Down

0 comments on commit e63d61b

Please sign in to comment.