Skip to content

Commit e8129bb

Browse files
authored
Merge pull request #27 from ww99w/master
check string is null
2 parents baad3a1 + be82afc commit e8129bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/number-format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function NumberFormat(config = options) {
4444

4545
this.toNumber = (string) => Number(string)
4646

47-
this.numberOnly = (string, regExp) => string.toString().replace(regExp, '')
47+
this.numberOnly = (string, regExp) => string?.toString().replace(regExp, '')
4848

4949
this.isNegative = this.sign() === '-'
5050

0 commit comments

Comments
 (0)