latest patch version (1.2.3) changes behavior if string is undefined
Closed this issue · 3 comments
sballesteros commented
The change from re.test(string)
to string.match(re)
result in a different behavior if string
is undefined (calling .test
on undefined will throw a TypeError).
Maybe put a guard like if (typeof string == 'string') return false
to avoid that or consider bumping the major version as 1.2.3 can be considered as a change introducing a breaking change.
davisjam commented
@sballesteros @cadente-nd Thank you for pointing this out.
This is a bug in #18. I was trying to keep all existing behavior the same, but there was no test case for this so I missed it.
#20 will fix this issue.
davisjam commented
@sballesteros If #20 solves your problem, can you close this issue?
#20 is available in is-url version 1.2.4 on npm.
sballesteros commented
@davisjam thanks!