kaungmyatlwin / myanmar-phonenumber

Javascript module port (for browsers and node) of (https://github.com/Melomap/mm_phonenumber) to check valid myanmar mobile numbers, get mobile operator's name, sanitize mobile numbers and get mobile network types.
Apache License 2.0
63 stars 16 forks source link

Not working with empty string #9

Closed kaungmyathan22 closed 1 year ago

kaungmyathan22 commented 4 years ago

let phone="" when calling isValidMMPhoneNumber(phone) return nothing. and let phone=" "; when calling isValidMMPhoneNumber(phone) return false.

kaungmyatlwin commented 4 years ago

This is intended behavior. Do you have a better suggestion?

kaungmyatlwin commented 1 year ago

Ok coming back to the issue, I see the point you were making. I apologize.

Will release the new version with empty string check to return Boolean.

kaungmyatlwin commented 1 year ago

@kaungmyathan22 For phone = ' ', we now will throw an error Phone number is empty.. I don't think it would make sense to return false for such an empty string.

kaungmyatlwin commented 1 year ago

Fix provided in https://github.com/kaungmyatlwin/myanmar-phonenumber/commit/1975dd65abebb2fc24751f10a6e002421dffc5a9.