libphonenumber-js 1.13.7 → 1.13.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (830) hide show
  1. package/.gitlab-ci.yml +50 -50
  2. package/AUTHORS +4 -4
  3. package/CHANGELOG.md +984 -971
  4. package/CODE_OF_CONDUCT.md +78 -78
  5. package/LICENSE +21 -21
  6. package/LICENSE.Apache +175 -175
  7. package/README.md +2110 -2110
  8. package/build/AsYouType.js +70 -70
  9. package/build/AsYouType.js.map +1 -1
  10. package/build/AsYouType.test.js.map +1 -1
  11. package/build/AsYouTypeFormatter.PatternMatcher.js +6 -6
  12. package/build/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
  13. package/build/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
  14. package/build/AsYouTypeFormatter.PatternParser.js.map +1 -1
  15. package/build/AsYouTypeFormatter.PatternParser.test.js.map +1 -1
  16. package/build/AsYouTypeFormatter.complete.js.map +1 -1
  17. package/build/AsYouTypeFormatter.js +11 -11
  18. package/build/AsYouTypeFormatter.js.map +1 -1
  19. package/build/AsYouTypeFormatter.util.js.map +1 -1
  20. package/build/AsYouTypeFormatter.util.test.js.map +1 -1
  21. package/build/AsYouTypeParser.js +26 -26
  22. package/build/AsYouTypeParser.js.map +1 -1
  23. package/build/AsYouTypeState.js +6 -6
  24. package/build/AsYouTypeState.js.map +1 -1
  25. package/build/ParseError.js.map +1 -1
  26. package/build/PhoneNumber.js +5 -5
  27. package/build/PhoneNumber.js.map +1 -1
  28. package/build/PhoneNumber.test.js.map +1 -1
  29. package/build/PhoneNumberMatcher.js +60 -60
  30. package/build/PhoneNumberMatcher.js.map +1 -1
  31. package/build/PhoneNumberMatcher.test.js.map +1 -1
  32. package/build/constants.js.map +1 -1
  33. package/build/findNumbers/LRUCache.js.map +1 -1
  34. package/build/findNumbers/Leniency.js +34 -34
  35. package/build/findNumbers/Leniency.js.map +1 -1
  36. package/build/findNumbers/RegExpCache.js.map +1 -1
  37. package/build/findNumbers/isValidCandidate.js +14 -14
  38. package/build/findNumbers/isValidCandidate.js.map +1 -1
  39. package/build/findNumbers/isValidPreCandidate.js.map +1 -1
  40. package/build/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +6 -6
  41. package/build/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js.map +1 -1
  42. package/build/findNumbers/parsePreCandidate.js.map +1 -1
  43. package/build/findNumbers/utf-8.js +19 -19
  44. package/build/findNumbers/utf-8.js.map +1 -1
  45. package/build/findNumbers/util.js +3 -3
  46. package/build/findNumbers/util.js.map +1 -1
  47. package/build/findNumbers/util.test.js.map +1 -1
  48. package/build/findPhoneNumbersInText.js.map +1 -1
  49. package/build/findPhoneNumbersInText.test.js.map +1 -1
  50. package/build/format.js +14 -14
  51. package/build/format.js.map +1 -1
  52. package/build/format.test.js.map +1 -1
  53. package/build/formatIncompletePhoneNumber.js +7 -7
  54. package/build/formatIncompletePhoneNumber.js.map +1 -1
  55. package/build/formatIncompletePhoneNumber.test.js.map +1 -1
  56. package/build/formatPhoneNumberForMobileDialing.js +35 -35
  57. package/build/formatPhoneNumberForMobileDialing.js.map +1 -1
  58. package/build/getCountries.js.map +1 -1
  59. package/build/getCountries.test.js.map +1 -1
  60. package/build/getCountryCallingCode.js.map +1 -1
  61. package/build/getCountryCallingCode.test.js.map +1 -1
  62. package/build/getExampleNumber.js.map +1 -1
  63. package/build/getExampleNumber.test.js.map +1 -1
  64. package/build/helpers/RFC3966.js +6 -6
  65. package/build/helpers/RFC3966.js.map +1 -1
  66. package/build/helpers/RFC3966.test.js.map +1 -1
  67. package/build/helpers/applyInternationalSeparatorStyle.js.map +1 -1
  68. package/build/helpers/applyInternationalSeparatorStyle.test.js.map +1 -1
  69. package/build/helpers/checkNumberLength.js +15 -15
  70. package/build/helpers/checkNumberLength.js.map +1 -1
  71. package/build/helpers/checkNumberLength.test.js.map +1 -1
  72. package/build/helpers/extension/createExtensionPattern.js +10 -10
  73. package/build/helpers/extension/createExtensionPattern.js.map +1 -1
  74. package/build/helpers/extension/extractExtension.js.map +1 -1
  75. package/build/helpers/extractCountryCallingCode.js +23 -23
  76. package/build/helpers/extractCountryCallingCode.js.map +1 -1
  77. package/build/helpers/extractCountryCallingCode.test.js.map +1 -1
  78. package/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +9 -9
  79. package/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
  80. package/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.test.js.map +1 -1
  81. package/build/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +4 -4
  82. package/build/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
  83. package/build/helpers/extractNationalNumber.js +15 -15
  84. package/build/helpers/extractNationalNumber.js.map +1 -1
  85. package/build/helpers/extractNationalNumber.test.js.map +1 -1
  86. package/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -12
  87. package/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
  88. package/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.test.js.map +1 -1
  89. package/build/helpers/extractPhoneContext.js +17 -17
  90. package/build/helpers/extractPhoneContext.js.map +1 -1
  91. package/build/helpers/extractPhoneContext.test.js.map +1 -1
  92. package/build/helpers/formatNationalNumberUsingFormat.js.map +1 -1
  93. package/build/helpers/getCountryAndCallingCodeFromOneOfThem.js.map +1 -1
  94. package/build/helpers/getCountryByCallingCode.js +7 -7
  95. package/build/helpers/getCountryByCallingCode.js.map +1 -1
  96. package/build/helpers/getCountryByNationalNumber.js +7 -7
  97. package/build/helpers/getCountryByNationalNumber.js.map +1 -1
  98. package/build/helpers/getIddPrefix.js +8 -8
  99. package/build/helpers/getIddPrefix.js.map +1 -1
  100. package/build/helpers/getNumberType.js.map +1 -1
  101. package/build/helpers/getNumberType.test.js.map +1 -1
  102. package/build/helpers/getPossibleCountriesForNumber.js +6 -6
  103. package/build/helpers/getPossibleCountriesForNumber.js.map +1 -1
  104. package/build/helpers/isCallingCode.js.map +1 -1
  105. package/build/helpers/isCallingCode.test.js.map +1 -1
  106. package/build/helpers/isCountryCode.js.map +1 -1
  107. package/build/helpers/isCountryCode.test.js.map +1 -1
  108. package/build/helpers/isObject.js.map +1 -1
  109. package/build/helpers/isViablePhoneNumber.js.map +1 -1
  110. package/build/helpers/matchesEntirely.js +4 -4
  111. package/build/helpers/matchesEntirely.js.map +1 -1
  112. package/build/helpers/matchesEntirely.test.js.map +1 -1
  113. package/build/helpers/mergeArrays.js +5 -5
  114. package/build/helpers/mergeArrays.js.map +1 -1
  115. package/build/helpers/mergeArrays.test.js.map +1 -1
  116. package/build/helpers/parseDigits.js +12 -12
  117. package/build/helpers/parseDigits.js.map +1 -1
  118. package/build/helpers/parseDigits.test.js.map +1 -1
  119. package/build/helpers/stripIddPrefix.js.map +1 -1
  120. package/build/helpers/stripIddPrefix.test.js.map +1 -1
  121. package/build/isPossible.js +17 -17
  122. package/build/isPossible.js.map +1 -1
  123. package/build/isPossible.test.js.map +1 -1
  124. package/build/isPossiblePhoneNumber.js.map +1 -1
  125. package/build/isPossiblePhoneNumber.test.js.map +1 -1
  126. package/build/isValid.js +33 -33
  127. package/build/isValid.js.map +1 -1
  128. package/build/isValid.test.js.map +1 -1
  129. package/build/isValidPhoneNumber.js.map +1 -1
  130. package/build/isValidPhoneNumber.test.js.map +1 -1
  131. package/build/legacy/PhoneNumberSearch.js +4 -4
  132. package/build/legacy/PhoneNumberSearch.js.map +1 -1
  133. package/build/legacy/findNumbers.js.map +1 -1
  134. package/build/legacy/findNumbers.test.js.map +1 -1
  135. package/build/legacy/findPhoneNumbers.js +2 -2
  136. package/build/legacy/findPhoneNumbers.js.map +1 -1
  137. package/build/legacy/findPhoneNumbers.test.js.map +1 -1
  138. package/build/legacy/findPhoneNumbersInitialImplementation.js +16 -16
  139. package/build/legacy/findPhoneNumbersInitialImplementation.js.map +1 -1
  140. package/build/legacy/format.js.map +1 -1
  141. package/build/legacy/format.test.js.map +1 -1
  142. package/build/legacy/getNumberType.js.map +1 -1
  143. package/build/legacy/getNumberType.test.js.map +1 -1
  144. package/build/legacy/isPossibleNumber.js +13 -13
  145. package/build/legacy/isPossibleNumber.js.map +1 -1
  146. package/build/legacy/isPossibleNumber.test.js.map +1 -1
  147. package/build/legacy/isValidNumber.js.map +1 -1
  148. package/build/legacy/isValidNumber.test.js.map +1 -1
  149. package/build/legacy/isValidNumberForRegion.js.map +1 -1
  150. package/build/legacy/isValidNumberForRegion.test.js.map +1 -1
  151. package/build/legacy/isValidNumberForRegion_.js +4 -4
  152. package/build/legacy/isValidNumberForRegion_.js.map +1 -1
  153. package/build/legacy/parse.js.map +1 -1
  154. package/build/legacy/parse.test.js.map +1 -1
  155. package/build/legacy/searchNumbers.js +2 -2
  156. package/build/legacy/searchNumbers.js.map +1 -1
  157. package/build/legacy/searchNumbers.test.js.map +1 -1
  158. package/build/metadata.js +40 -40
  159. package/build/metadata.js.map +1 -1
  160. package/build/metadata.test.js.map +1 -1
  161. package/build/normalizeArguments.js.map +1 -1
  162. package/build/parse.js +36 -36
  163. package/build/parse.js.map +1 -1
  164. package/build/parse.test.js.map +1 -1
  165. package/build/parseIncompletePhoneNumber.js +24 -24
  166. package/build/parseIncompletePhoneNumber.js.map +1 -1
  167. package/build/parseIncompletePhoneNumber.test.js.map +1 -1
  168. package/build/parsePhoneNumber.js.map +1 -1
  169. package/build/parsePhoneNumber.test.js.map +1 -1
  170. package/build/parsePhoneNumberWithError.js.map +1 -1
  171. package/build/parsePhoneNumberWithError.test.js.map +1 -1
  172. package/build/parsePhoneNumberWithError_.js.map +1 -1
  173. package/build/parsePhoneNumber_.js.map +1 -1
  174. package/build/searchPhoneNumbersInText.js.map +1 -1
  175. package/build/searchPhoneNumbersInText.test.js.map +1 -1
  176. package/build/tools/semver-compare.js.map +1 -1
  177. package/build/tools/semver-compare.test.js.map +1 -1
  178. package/build/validatePhoneNumberLength.js.map +1 -1
  179. package/build/validatePhoneNumberLength.test.js.map +1 -1
  180. package/bundle/libphonenumber-js.min.js +1 -1
  181. package/bundle/libphonenumber-js.min.js.map +1 -1
  182. package/bundle/libphonenumber-max.js +1 -1
  183. package/bundle/libphonenumber-max.js.map +1 -1
  184. package/bundle/libphonenumber-min.js +1 -1
  185. package/bundle/libphonenumber-min.js.map +1 -1
  186. package/bundle/libphonenumber-mobile.js +1 -1
  187. package/bundle/libphonenumber-mobile.js.map +1 -1
  188. package/core/es6/index.d.cts +2 -2
  189. package/core/es6/index.d.ts +2 -2
  190. package/core/es6/index.js +39 -39
  191. package/core/es6/package.json +12 -12
  192. package/core/index.cjs +57 -57
  193. package/core/index.cjs.js +62 -62
  194. package/core/index.d.cts +150 -150
  195. package/core/index.d.ts +150 -150
  196. package/core/index.js +39 -39
  197. package/core/package.json +14 -14
  198. package/custom.d.ts +209 -209
  199. package/custom.js +78 -78
  200. package/es6/AsYouType.js +70 -70
  201. package/es6/AsYouType.js.map +1 -1
  202. package/es6/AsYouType.test.js.map +1 -1
  203. package/es6/AsYouTypeFormatter.PatternMatcher.js +6 -6
  204. package/es6/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
  205. package/es6/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
  206. package/es6/AsYouTypeFormatter.PatternParser.js.map +1 -1
  207. package/es6/AsYouTypeFormatter.PatternParser.test.js.map +1 -1
  208. package/es6/AsYouTypeFormatter.complete.js.map +1 -1
  209. package/es6/AsYouTypeFormatter.js +11 -11
  210. package/es6/AsYouTypeFormatter.js.map +1 -1
  211. package/es6/AsYouTypeFormatter.util.js.map +1 -1
  212. package/es6/AsYouTypeFormatter.util.test.js.map +1 -1
  213. package/es6/AsYouTypeParser.js +26 -26
  214. package/es6/AsYouTypeParser.js.map +1 -1
  215. package/es6/AsYouTypeState.js +6 -6
  216. package/es6/AsYouTypeState.js.map +1 -1
  217. package/es6/ParseError.js.map +1 -1
  218. package/es6/PhoneNumber.js +5 -5
  219. package/es6/PhoneNumber.js.map +1 -1
  220. package/es6/PhoneNumber.test.js.map +1 -1
  221. package/es6/PhoneNumberMatcher.js +60 -60
  222. package/es6/PhoneNumberMatcher.js.map +1 -1
  223. package/es6/PhoneNumberMatcher.test.js.map +1 -1
  224. package/es6/constants.js.map +1 -1
  225. package/es6/findNumbers/LRUCache.js.map +1 -1
  226. package/es6/findNumbers/Leniency.js +34 -34
  227. package/es6/findNumbers/Leniency.js.map +1 -1
  228. package/es6/findNumbers/RegExpCache.js.map +1 -1
  229. package/es6/findNumbers/isValidCandidate.js +14 -14
  230. package/es6/findNumbers/isValidCandidate.js.map +1 -1
  231. package/es6/findNumbers/isValidPreCandidate.js.map +1 -1
  232. package/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +6 -6
  233. package/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js.map +1 -1
  234. package/es6/findNumbers/parsePreCandidate.js.map +1 -1
  235. package/es6/findNumbers/utf-8.js +19 -19
  236. package/es6/findNumbers/utf-8.js.map +1 -1
  237. package/es6/findNumbers/util.js +3 -3
  238. package/es6/findNumbers/util.js.map +1 -1
  239. package/es6/findNumbers/util.test.js.map +1 -1
  240. package/es6/findPhoneNumbersInText.js.map +1 -1
  241. package/es6/findPhoneNumbersInText.test.js.map +1 -1
  242. package/es6/format.js +14 -14
  243. package/es6/format.js.map +1 -1
  244. package/es6/format.test.js.map +1 -1
  245. package/es6/formatIncompletePhoneNumber.js +7 -7
  246. package/es6/formatIncompletePhoneNumber.js.map +1 -1
  247. package/es6/formatIncompletePhoneNumber.test.js.map +1 -1
  248. package/es6/formatPhoneNumberForMobileDialing.js +35 -35
  249. package/es6/formatPhoneNumberForMobileDialing.js.map +1 -1
  250. package/es6/getCountries.js.map +1 -1
  251. package/es6/getCountries.test.js.map +1 -1
  252. package/es6/getCountryCallingCode.js.map +1 -1
  253. package/es6/getCountryCallingCode.test.js.map +1 -1
  254. package/es6/getExampleNumber.js.map +1 -1
  255. package/es6/getExampleNumber.test.js.map +1 -1
  256. package/es6/helpers/RFC3966.js +6 -6
  257. package/es6/helpers/RFC3966.js.map +1 -1
  258. package/es6/helpers/RFC3966.test.js.map +1 -1
  259. package/es6/helpers/applyInternationalSeparatorStyle.js.map +1 -1
  260. package/es6/helpers/applyInternationalSeparatorStyle.test.js.map +1 -1
  261. package/es6/helpers/checkNumberLength.js +15 -15
  262. package/es6/helpers/checkNumberLength.js.map +1 -1
  263. package/es6/helpers/checkNumberLength.test.js.map +1 -1
  264. package/es6/helpers/extension/createExtensionPattern.js +10 -10
  265. package/es6/helpers/extension/createExtensionPattern.js.map +1 -1
  266. package/es6/helpers/extension/extractExtension.js.map +1 -1
  267. package/es6/helpers/extractCountryCallingCode.js +23 -23
  268. package/es6/helpers/extractCountryCallingCode.js.map +1 -1
  269. package/es6/helpers/extractCountryCallingCode.test.js.map +1 -1
  270. package/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +9 -9
  271. package/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
  272. package/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.test.js.map +1 -1
  273. package/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +4 -4
  274. package/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
  275. package/es6/helpers/extractNationalNumber.js +15 -15
  276. package/es6/helpers/extractNationalNumber.js.map +1 -1
  277. package/es6/helpers/extractNationalNumber.test.js.map +1 -1
  278. package/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -12
  279. package/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
  280. package/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.test.js.map +1 -1
  281. package/es6/helpers/extractPhoneContext.js +17 -17
  282. package/es6/helpers/extractPhoneContext.js.map +1 -1
  283. package/es6/helpers/extractPhoneContext.test.js.map +1 -1
  284. package/es6/helpers/formatNationalNumberUsingFormat.js.map +1 -1
  285. package/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js.map +1 -1
  286. package/es6/helpers/getCountryByCallingCode.js +7 -7
  287. package/es6/helpers/getCountryByCallingCode.js.map +1 -1
  288. package/es6/helpers/getCountryByNationalNumber.js +7 -7
  289. package/es6/helpers/getCountryByNationalNumber.js.map +1 -1
  290. package/es6/helpers/getIddPrefix.js +8 -8
  291. package/es6/helpers/getIddPrefix.js.map +1 -1
  292. package/es6/helpers/getNumberType.js.map +1 -1
  293. package/es6/helpers/getNumberType.test.js.map +1 -1
  294. package/es6/helpers/getPossibleCountriesForNumber.js +6 -6
  295. package/es6/helpers/getPossibleCountriesForNumber.js.map +1 -1
  296. package/es6/helpers/isCallingCode.js.map +1 -1
  297. package/es6/helpers/isCallingCode.test.js.map +1 -1
  298. package/es6/helpers/isCountryCode.js.map +1 -1
  299. package/es6/helpers/isCountryCode.test.js.map +1 -1
  300. package/es6/helpers/isObject.js.map +1 -1
  301. package/es6/helpers/isViablePhoneNumber.js.map +1 -1
  302. package/es6/helpers/matchesEntirely.js +4 -4
  303. package/es6/helpers/matchesEntirely.js.map +1 -1
  304. package/es6/helpers/matchesEntirely.test.js.map +1 -1
  305. package/es6/helpers/mergeArrays.js +5 -5
  306. package/es6/helpers/mergeArrays.js.map +1 -1
  307. package/es6/helpers/mergeArrays.test.js.map +1 -1
  308. package/es6/helpers/parseDigits.js +12 -12
  309. package/es6/helpers/parseDigits.js.map +1 -1
  310. package/es6/helpers/parseDigits.test.js.map +1 -1
  311. package/es6/helpers/stripIddPrefix.js.map +1 -1
  312. package/es6/helpers/stripIddPrefix.test.js.map +1 -1
  313. package/es6/isPossible.js +17 -17
  314. package/es6/isPossible.js.map +1 -1
  315. package/es6/isPossible.test.js.map +1 -1
  316. package/es6/isPossiblePhoneNumber.js.map +1 -1
  317. package/es6/isPossiblePhoneNumber.test.js.map +1 -1
  318. package/es6/isValid.js +33 -33
  319. package/es6/isValid.js.map +1 -1
  320. package/es6/isValid.test.js.map +1 -1
  321. package/es6/isValidPhoneNumber.js.map +1 -1
  322. package/es6/isValidPhoneNumber.test.js.map +1 -1
  323. package/es6/legacy/PhoneNumberSearch.js +4 -4
  324. package/es6/legacy/PhoneNumberSearch.js.map +1 -1
  325. package/es6/legacy/findNumbers.js.map +1 -1
  326. package/es6/legacy/findNumbers.test.js.map +1 -1
  327. package/es6/legacy/findPhoneNumbers.js +2 -2
  328. package/es6/legacy/findPhoneNumbers.js.map +1 -1
  329. package/es6/legacy/findPhoneNumbers.test.js.map +1 -1
  330. package/es6/legacy/findPhoneNumbersInitialImplementation.js +16 -16
  331. package/es6/legacy/findPhoneNumbersInitialImplementation.js.map +1 -1
  332. package/es6/legacy/format.js.map +1 -1
  333. package/es6/legacy/format.test.js.map +1 -1
  334. package/es6/legacy/getNumberType.js.map +1 -1
  335. package/es6/legacy/getNumberType.test.js.map +1 -1
  336. package/es6/legacy/isPossibleNumber.js +13 -13
  337. package/es6/legacy/isPossibleNumber.js.map +1 -1
  338. package/es6/legacy/isPossibleNumber.test.js.map +1 -1
  339. package/es6/legacy/isValidNumber.js.map +1 -1
  340. package/es6/legacy/isValidNumber.test.js.map +1 -1
  341. package/es6/legacy/isValidNumberForRegion.js.map +1 -1
  342. package/es6/legacy/isValidNumberForRegion.test.js.map +1 -1
  343. package/es6/legacy/isValidNumberForRegion_.js +4 -4
  344. package/es6/legacy/isValidNumberForRegion_.js.map +1 -1
  345. package/es6/legacy/parse.js.map +1 -1
  346. package/es6/legacy/parse.test.js.map +1 -1
  347. package/es6/legacy/searchNumbers.js +2 -2
  348. package/es6/legacy/searchNumbers.js.map +1 -1
  349. package/es6/legacy/searchNumbers.test.js.map +1 -1
  350. package/es6/metadata.js +40 -40
  351. package/es6/metadata.js.map +1 -1
  352. package/es6/metadata.test.js.map +1 -1
  353. package/es6/normalizeArguments.js.map +1 -1
  354. package/es6/parse.js +36 -36
  355. package/es6/parse.js.map +1 -1
  356. package/es6/parse.test.js.map +1 -1
  357. package/es6/parseIncompletePhoneNumber.js +24 -24
  358. package/es6/parseIncompletePhoneNumber.js.map +1 -1
  359. package/es6/parseIncompletePhoneNumber.test.js.map +1 -1
  360. package/es6/parsePhoneNumber.js.map +1 -1
  361. package/es6/parsePhoneNumber.test.js.map +1 -1
  362. package/es6/parsePhoneNumberWithError.js.map +1 -1
  363. package/es6/parsePhoneNumberWithError.test.js.map +1 -1
  364. package/es6/parsePhoneNumberWithError_.js.map +1 -1
  365. package/es6/parsePhoneNumber_.js.map +1 -1
  366. package/es6/searchPhoneNumbersInText.js.map +1 -1
  367. package/es6/searchPhoneNumbersInText.test.js.map +1 -1
  368. package/es6/tools/semver-compare.js.map +1 -1
  369. package/es6/tools/semver-compare.test.js.map +1 -1
  370. package/es6/validatePhoneNumberLength.js.map +1 -1
  371. package/es6/validatePhoneNumberLength.test.js.map +1 -1
  372. package/es6-modern/AsYouType.js +70 -70
  373. package/es6-modern/AsYouType.js.map +1 -1
  374. package/es6-modern/AsYouType.test.js.map +1 -1
  375. package/es6-modern/AsYouTypeFormatter.PatternMatcher.js +6 -6
  376. package/es6-modern/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
  377. package/es6-modern/AsYouTypeFormatter.PatternMatcher.test.js.map +1 -1
  378. package/es6-modern/AsYouTypeFormatter.PatternParser.js.map +1 -1
  379. package/es6-modern/AsYouTypeFormatter.PatternParser.test.js.map +1 -1
  380. package/es6-modern/AsYouTypeFormatter.complete.js.map +1 -1
  381. package/es6-modern/AsYouTypeFormatter.js +11 -11
  382. package/es6-modern/AsYouTypeFormatter.js.map +1 -1
  383. package/es6-modern/AsYouTypeFormatter.util.js.map +1 -1
  384. package/es6-modern/AsYouTypeFormatter.util.test.js.map +1 -1
  385. package/es6-modern/AsYouTypeParser.js +26 -26
  386. package/es6-modern/AsYouTypeParser.js.map +1 -1
  387. package/es6-modern/AsYouTypeState.js +6 -6
  388. package/es6-modern/AsYouTypeState.js.map +1 -1
  389. package/es6-modern/ParseError.js.map +1 -1
  390. package/es6-modern/PhoneNumber.js +5 -5
  391. package/es6-modern/PhoneNumber.js.map +1 -1
  392. package/es6-modern/PhoneNumber.test.js.map +1 -1
  393. package/es6-modern/PhoneNumberMatcher.js +60 -60
  394. package/es6-modern/PhoneNumberMatcher.js.map +1 -1
  395. package/es6-modern/PhoneNumberMatcher.test.js.map +1 -1
  396. package/es6-modern/constants.js.map +1 -1
  397. package/es6-modern/findNumbers/LRUCache.js.map +1 -1
  398. package/es6-modern/findNumbers/Leniency.js +34 -34
  399. package/es6-modern/findNumbers/Leniency.js.map +1 -1
  400. package/es6-modern/findNumbers/RegExpCache.js.map +1 -1
  401. package/es6-modern/findNumbers/isValidCandidate.js +14 -14
  402. package/es6-modern/findNumbers/isValidCandidate.js.map +1 -1
  403. package/es6-modern/findNumbers/isValidPreCandidate.js.map +1 -1
  404. package/es6-modern/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +6 -6
  405. package/es6-modern/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js.map +1 -1
  406. package/es6-modern/findNumbers/parsePreCandidate.js.map +1 -1
  407. package/es6-modern/findNumbers/utf-8.js +19 -19
  408. package/es6-modern/findNumbers/utf-8.js.map +1 -1
  409. package/es6-modern/findNumbers/util.js +3 -3
  410. package/es6-modern/findNumbers/util.js.map +1 -1
  411. package/es6-modern/findNumbers/util.test.js.map +1 -1
  412. package/es6-modern/findPhoneNumbersInText.js.map +1 -1
  413. package/es6-modern/findPhoneNumbersInText.test.js.map +1 -1
  414. package/es6-modern/format.js +14 -14
  415. package/es6-modern/format.js.map +1 -1
  416. package/es6-modern/format.test.js.map +1 -1
  417. package/es6-modern/formatIncompletePhoneNumber.js +7 -7
  418. package/es6-modern/formatIncompletePhoneNumber.js.map +1 -1
  419. package/es6-modern/formatIncompletePhoneNumber.test.js.map +1 -1
  420. package/es6-modern/formatPhoneNumberForMobileDialing.js +35 -35
  421. package/es6-modern/formatPhoneNumberForMobileDialing.js.map +1 -1
  422. package/es6-modern/getCountries.js.map +1 -1
  423. package/es6-modern/getCountries.test.js.map +1 -1
  424. package/es6-modern/getCountryCallingCode.js.map +1 -1
  425. package/es6-modern/getCountryCallingCode.test.js.map +1 -1
  426. package/es6-modern/getExampleNumber.js.map +1 -1
  427. package/es6-modern/getExampleNumber.test.js.map +1 -1
  428. package/es6-modern/helpers/RFC3966.js +6 -6
  429. package/es6-modern/helpers/RFC3966.js.map +1 -1
  430. package/es6-modern/helpers/RFC3966.test.js.map +1 -1
  431. package/es6-modern/helpers/applyInternationalSeparatorStyle.js.map +1 -1
  432. package/es6-modern/helpers/applyInternationalSeparatorStyle.test.js.map +1 -1
  433. package/es6-modern/helpers/checkNumberLength.js +15 -15
  434. package/es6-modern/helpers/checkNumberLength.js.map +1 -1
  435. package/es6-modern/helpers/checkNumberLength.test.js.map +1 -1
  436. package/es6-modern/helpers/extension/createExtensionPattern.js +10 -10
  437. package/es6-modern/helpers/extension/createExtensionPattern.js.map +1 -1
  438. package/es6-modern/helpers/extension/extractExtension.js.map +1 -1
  439. package/es6-modern/helpers/extractCountryCallingCode.js +23 -23
  440. package/es6-modern/helpers/extractCountryCallingCode.js.map +1 -1
  441. package/es6-modern/helpers/extractCountryCallingCode.test.js.map +1 -1
  442. package/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +9 -9
  443. package/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
  444. package/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.test.js.map +1 -1
  445. package/es6-modern/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +4 -4
  446. package/es6-modern/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
  447. package/es6-modern/helpers/extractNationalNumber.js +15 -15
  448. package/es6-modern/helpers/extractNationalNumber.js.map +1 -1
  449. package/es6-modern/helpers/extractNationalNumber.test.js.map +1 -1
  450. package/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -12
  451. package/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
  452. package/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.test.js.map +1 -1
  453. package/es6-modern/helpers/extractPhoneContext.js +17 -17
  454. package/es6-modern/helpers/extractPhoneContext.js.map +1 -1
  455. package/es6-modern/helpers/extractPhoneContext.test.js.map +1 -1
  456. package/es6-modern/helpers/formatNationalNumberUsingFormat.js.map +1 -1
  457. package/es6-modern/helpers/getCountryAndCallingCodeFromOneOfThem.js.map +1 -1
  458. package/es6-modern/helpers/getCountryByCallingCode.js +7 -7
  459. package/es6-modern/helpers/getCountryByCallingCode.js.map +1 -1
  460. package/es6-modern/helpers/getCountryByNationalNumber.js +7 -7
  461. package/es6-modern/helpers/getCountryByNationalNumber.js.map +1 -1
  462. package/es6-modern/helpers/getIddPrefix.js +8 -8
  463. package/es6-modern/helpers/getIddPrefix.js.map +1 -1
  464. package/es6-modern/helpers/getNumberType.js.map +1 -1
  465. package/es6-modern/helpers/getNumberType.test.js.map +1 -1
  466. package/es6-modern/helpers/getPossibleCountriesForNumber.js +6 -6
  467. package/es6-modern/helpers/getPossibleCountriesForNumber.js.map +1 -1
  468. package/es6-modern/helpers/isCallingCode.js.map +1 -1
  469. package/es6-modern/helpers/isCallingCode.test.js.map +1 -1
  470. package/es6-modern/helpers/isCountryCode.js.map +1 -1
  471. package/es6-modern/helpers/isCountryCode.test.js.map +1 -1
  472. package/es6-modern/helpers/isObject.js.map +1 -1
  473. package/es6-modern/helpers/isViablePhoneNumber.js.map +1 -1
  474. package/es6-modern/helpers/matchesEntirely.js +4 -4
  475. package/es6-modern/helpers/matchesEntirely.js.map +1 -1
  476. package/es6-modern/helpers/matchesEntirely.test.js.map +1 -1
  477. package/es6-modern/helpers/mergeArrays.js +5 -5
  478. package/es6-modern/helpers/mergeArrays.js.map +1 -1
  479. package/es6-modern/helpers/mergeArrays.test.js.map +1 -1
  480. package/es6-modern/helpers/parseDigits.js +12 -12
  481. package/es6-modern/helpers/parseDigits.js.map +1 -1
  482. package/es6-modern/helpers/parseDigits.test.js.map +1 -1
  483. package/es6-modern/helpers/stripIddPrefix.js.map +1 -1
  484. package/es6-modern/helpers/stripIddPrefix.test.js.map +1 -1
  485. package/es6-modern/isPossible.js +17 -17
  486. package/es6-modern/isPossible.js.map +1 -1
  487. package/es6-modern/isPossible.test.js.map +1 -1
  488. package/es6-modern/isPossiblePhoneNumber.js.map +1 -1
  489. package/es6-modern/isPossiblePhoneNumber.test.js.map +1 -1
  490. package/es6-modern/isValid.js +33 -33
  491. package/es6-modern/isValid.js.map +1 -1
  492. package/es6-modern/isValid.test.js.map +1 -1
  493. package/es6-modern/isValidPhoneNumber.js.map +1 -1
  494. package/es6-modern/isValidPhoneNumber.test.js.map +1 -1
  495. package/es6-modern/legacy/PhoneNumberSearch.js +4 -4
  496. package/es6-modern/legacy/PhoneNumberSearch.js.map +1 -1
  497. package/es6-modern/legacy/findNumbers.js.map +1 -1
  498. package/es6-modern/legacy/findNumbers.test.js.map +1 -1
  499. package/es6-modern/legacy/findPhoneNumbers.js +2 -2
  500. package/es6-modern/legacy/findPhoneNumbers.js.map +1 -1
  501. package/es6-modern/legacy/findPhoneNumbers.test.js.map +1 -1
  502. package/es6-modern/legacy/findPhoneNumbersInitialImplementation.js +16 -16
  503. package/es6-modern/legacy/findPhoneNumbersInitialImplementation.js.map +1 -1
  504. package/es6-modern/legacy/format.js.map +1 -1
  505. package/es6-modern/legacy/format.test.js.map +1 -1
  506. package/es6-modern/legacy/getNumberType.js.map +1 -1
  507. package/es6-modern/legacy/getNumberType.test.js.map +1 -1
  508. package/es6-modern/legacy/isPossibleNumber.js +13 -13
  509. package/es6-modern/legacy/isPossibleNumber.js.map +1 -1
  510. package/es6-modern/legacy/isPossibleNumber.test.js.map +1 -1
  511. package/es6-modern/legacy/isValidNumber.js.map +1 -1
  512. package/es6-modern/legacy/isValidNumber.test.js.map +1 -1
  513. package/es6-modern/legacy/isValidNumberForRegion.js.map +1 -1
  514. package/es6-modern/legacy/isValidNumberForRegion.test.js.map +1 -1
  515. package/es6-modern/legacy/isValidNumberForRegion_.js +4 -4
  516. package/es6-modern/legacy/isValidNumberForRegion_.js.map +1 -1
  517. package/es6-modern/legacy/parse.js.map +1 -1
  518. package/es6-modern/legacy/parse.test.js.map +1 -1
  519. package/es6-modern/legacy/searchNumbers.js +2 -2
  520. package/es6-modern/legacy/searchNumbers.js.map +1 -1
  521. package/es6-modern/legacy/searchNumbers.test.js.map +1 -1
  522. package/es6-modern/metadata.js +40 -40
  523. package/es6-modern/metadata.js.map +1 -1
  524. package/es6-modern/metadata.test.js.map +1 -1
  525. package/es6-modern/normalizeArguments.js.map +1 -1
  526. package/es6-modern/parse.js +36 -36
  527. package/es6-modern/parse.js.map +1 -1
  528. package/es6-modern/parse.test.js.map +1 -1
  529. package/es6-modern/parseIncompletePhoneNumber.js +24 -24
  530. package/es6-modern/parseIncompletePhoneNumber.js.map +1 -1
  531. package/es6-modern/parseIncompletePhoneNumber.test.js.map +1 -1
  532. package/es6-modern/parsePhoneNumber.js.map +1 -1
  533. package/es6-modern/parsePhoneNumber.test.js.map +1 -1
  534. package/es6-modern/parsePhoneNumberWithError.js.map +1 -1
  535. package/es6-modern/parsePhoneNumberWithError.test.js.map +1 -1
  536. package/es6-modern/parsePhoneNumberWithError_.js.map +1 -1
  537. package/es6-modern/parsePhoneNumber_.js.map +1 -1
  538. package/es6-modern/searchPhoneNumbersInText.js.map +1 -1
  539. package/es6-modern/searchPhoneNumbersInText.test.js.map +1 -1
  540. package/es6-modern/tools/semver-compare.js.map +1 -1
  541. package/es6-modern/tools/semver-compare.test.js.map +1 -1
  542. package/es6-modern/validatePhoneNumberLength.js.map +1 -1
  543. package/es6-modern/validatePhoneNumberLength.test.js.map +1 -1
  544. package/examples.mobile.json.d.cts +3 -3
  545. package/examples.mobile.json.d.ts +3 -3
  546. package/index.cjs +129 -129
  547. package/index.cjs.js +135 -135
  548. package/index.d.cts +232 -232
  549. package/index.d.ts +232 -232
  550. package/index.es6.exports/PhoneNumberSearch.js +13 -13
  551. package/index.es6.exports/findPhoneNumbers.js +7 -7
  552. package/index.es6.exports/format.js +7 -7
  553. package/index.es6.exports/getNumberType.js +7 -7
  554. package/index.es6.exports/isPossibleNumber.js +9 -9
  555. package/index.es6.exports/isValidNumber.js +9 -9
  556. package/index.es6.exports/isValidNumberForRegion.js +7 -7
  557. package/index.es6.exports/parse.js +7 -7
  558. package/index.es6.exports/searchPhoneNumbers.js +7 -7
  559. package/index.es6.js +5 -5
  560. package/index.js +72 -72
  561. package/max/es6/exports/AsYouType.js +11 -11
  562. package/max/es6/exports/Metadata.js +11 -11
  563. package/max/es6/exports/PhoneNumber.js +11 -11
  564. package/max/es6/exports/PhoneNumberMatcher.js +11 -11
  565. package/max/es6/exports/findNumbers.js +5 -5
  566. package/max/es6/exports/findPhoneNumbersInText.js +5 -5
  567. package/max/es6/exports/formatIncompletePhoneNumber.js +5 -5
  568. package/max/es6/exports/getCountries.js +5 -5
  569. package/max/es6/exports/getCountryCallingCode.js +5 -5
  570. package/max/es6/exports/getExampleNumber.js +5 -5
  571. package/max/es6/exports/getExtPrefix.js +5 -5
  572. package/max/es6/exports/isPossiblePhoneNumber.js +5 -5
  573. package/max/es6/exports/isSupportedCountry.js +5 -5
  574. package/max/es6/exports/isValidPhoneNumber.js +5 -5
  575. package/max/es6/exports/parsePhoneNumber.js +6 -6
  576. package/max/es6/exports/parsePhoneNumberWithError.js +7 -7
  577. package/max/es6/exports/searchNumbers.js +5 -5
  578. package/max/es6/exports/searchPhoneNumbersInText.js +5 -5
  579. package/max/es6/exports/validatePhoneNumberLength.js +5 -5
  580. package/max/es6/exports/withMetadataArgument.js +12 -12
  581. package/max/es6/index.d.cts +2 -2
  582. package/max/es6/index.d.ts +2 -2
  583. package/max/es6/index.js +44 -44
  584. package/max/es6/package.json +12 -12
  585. package/max/exports/AsYouType.js +11 -11
  586. package/max/exports/Metadata.js +11 -11
  587. package/max/exports/PhoneNumber.js +21 -21
  588. package/max/exports/PhoneNumberMatcher.js +11 -11
  589. package/max/exports/findNumbers.js +5 -5
  590. package/max/exports/findPhoneNumbersInText.js +5 -5
  591. package/max/exports/formatIncompletePhoneNumber.js +5 -5
  592. package/max/exports/getCountries.js +5 -5
  593. package/max/exports/getCountryCallingCode.js +5 -5
  594. package/max/exports/getExampleNumber.js +5 -5
  595. package/max/exports/getExtPrefix.js +5 -5
  596. package/max/exports/isPossiblePhoneNumber.js +5 -5
  597. package/max/exports/isSupportedCountry.js +5 -5
  598. package/max/exports/isValidPhoneNumber.js +5 -5
  599. package/max/exports/parsePhoneNumber.js +5 -5
  600. package/max/exports/parsePhoneNumberWithError.js +6 -6
  601. package/max/exports/searchNumbers.js +5 -5
  602. package/max/exports/searchPhoneNumbersInText.js +5 -5
  603. package/max/exports/validatePhoneNumberLength.js +5 -5
  604. package/max/exports/withMetadataArgument.js +8 -8
  605. package/max/index.cjs +113 -113
  606. package/max/index.cjs.js +118 -118
  607. package/max/index.d.cts +137 -137
  608. package/max/index.d.ts +137 -137
  609. package/max/index.js +44 -44
  610. package/max/metadata/metadata.max.json +1 -1
  611. package/max/metadata/metadata.max.json.d.cts +4 -4
  612. package/max/metadata/metadata.max.json.d.ts +4 -4
  613. package/max/metadata/metadata.max.json.js +1 -1
  614. package/max/metadata/package.json +16 -16
  615. package/max/package.json +14 -14
  616. package/metadata.full.json +1 -1
  617. package/metadata.full.json.d.cts +4 -4
  618. package/metadata.full.json.d.ts +4 -4
  619. package/metadata.full.json.js +1 -1
  620. package/metadata.max.json +1 -1
  621. package/metadata.max.json.d.cts +4 -4
  622. package/metadata.max.json.d.ts +4 -4
  623. package/metadata.max.json.js +1 -1
  624. package/metadata.min.json +1 -1
  625. package/metadata.min.json.d.cts +4 -4
  626. package/metadata.min.json.d.ts +4 -4
  627. package/metadata.min.json.js +1 -1
  628. package/metadata.mobile.json +1 -1
  629. package/metadata.mobile.json.d.cts +4 -4
  630. package/metadata.mobile.json.d.ts +4 -4
  631. package/metadata.mobile.json.js +1 -1
  632. package/min/es6/exports/AsYouType.js +11 -11
  633. package/min/es6/exports/Metadata.js +11 -11
  634. package/min/es6/exports/PhoneNumber.js +11 -11
  635. package/min/es6/exports/PhoneNumberMatcher.js +11 -11
  636. package/min/es6/exports/findNumbers.js +5 -5
  637. package/min/es6/exports/findPhoneNumbersInText.js +5 -5
  638. package/min/es6/exports/formatIncompletePhoneNumber.js +5 -5
  639. package/min/es6/exports/getCountries.js +5 -5
  640. package/min/es6/exports/getCountryCallingCode.js +5 -5
  641. package/min/es6/exports/getExampleNumber.js +5 -5
  642. package/min/es6/exports/getExtPrefix.js +5 -5
  643. package/min/es6/exports/isPossiblePhoneNumber.js +5 -5
  644. package/min/es6/exports/isSupportedCountry.js +5 -5
  645. package/min/es6/exports/isValidPhoneNumber.js +5 -5
  646. package/min/es6/exports/parsePhoneNumber.js +6 -6
  647. package/min/es6/exports/parsePhoneNumberWithError.js +7 -7
  648. package/min/es6/exports/searchNumbers.js +5 -5
  649. package/min/es6/exports/searchPhoneNumbersInText.js +5 -5
  650. package/min/es6/exports/validatePhoneNumberLength.js +5 -5
  651. package/min/es6/exports/withMetadataArgument.js +12 -12
  652. package/min/es6/index.d.cts +2 -2
  653. package/min/es6/index.d.ts +2 -2
  654. package/min/es6/index.js +44 -44
  655. package/min/es6/package.json +12 -12
  656. package/min/exports/AsYouType.js +11 -11
  657. package/min/exports/Metadata.js +11 -11
  658. package/min/exports/PhoneNumber.js +21 -21
  659. package/min/exports/PhoneNumberMatcher.js +11 -11
  660. package/min/exports/findNumbers.js +5 -5
  661. package/min/exports/findPhoneNumbersInText.js +5 -5
  662. package/min/exports/formatIncompletePhoneNumber.js +5 -5
  663. package/min/exports/getCountries.js +5 -5
  664. package/min/exports/getCountryCallingCode.js +5 -5
  665. package/min/exports/getExampleNumber.js +5 -5
  666. package/min/exports/getExtPrefix.js +5 -5
  667. package/min/exports/isPossiblePhoneNumber.js +5 -5
  668. package/min/exports/isSupportedCountry.js +5 -5
  669. package/min/exports/isValidPhoneNumber.js +5 -5
  670. package/min/exports/parsePhoneNumber.js +5 -5
  671. package/min/exports/parsePhoneNumberWithError.js +6 -6
  672. package/min/exports/searchNumbers.js +5 -5
  673. package/min/exports/searchPhoneNumbersInText.js +5 -5
  674. package/min/exports/validatePhoneNumberLength.js +5 -5
  675. package/min/exports/withMetadataArgument.js +8 -8
  676. package/min/index.cjs +124 -124
  677. package/min/index.cjs.js +129 -129
  678. package/min/index.d.cts +137 -137
  679. package/min/index.d.ts +137 -137
  680. package/min/index.js +43 -43
  681. package/min/metadata/metadata.min.json +1 -1
  682. package/min/metadata/metadata.min.json.d.cts +4 -4
  683. package/min/metadata/metadata.min.json.d.ts +4 -4
  684. package/min/metadata/metadata.min.json.js +1 -1
  685. package/min/metadata/package.json +16 -16
  686. package/min/package.json +14 -14
  687. package/mobile/es6/exports/AsYouType.js +11 -11
  688. package/mobile/es6/exports/Metadata.js +11 -11
  689. package/mobile/es6/exports/PhoneNumber.js +11 -11
  690. package/mobile/es6/exports/PhoneNumberMatcher.js +11 -11
  691. package/mobile/es6/exports/findNumbers.js +5 -5
  692. package/mobile/es6/exports/findPhoneNumbersInText.js +5 -5
  693. package/mobile/es6/exports/formatIncompletePhoneNumber.js +5 -5
  694. package/mobile/es6/exports/getCountries.js +5 -5
  695. package/mobile/es6/exports/getCountryCallingCode.js +5 -5
  696. package/mobile/es6/exports/getExampleNumber.js +5 -5
  697. package/mobile/es6/exports/getExtPrefix.js +5 -5
  698. package/mobile/es6/exports/isPossiblePhoneNumber.js +5 -5
  699. package/mobile/es6/exports/isSupportedCountry.js +5 -5
  700. package/mobile/es6/exports/isValidPhoneNumber.js +5 -5
  701. package/mobile/es6/exports/parsePhoneNumber.js +6 -6
  702. package/mobile/es6/exports/parsePhoneNumberWithError.js +7 -7
  703. package/mobile/es6/exports/searchNumbers.js +5 -5
  704. package/mobile/es6/exports/searchPhoneNumbersInText.js +5 -5
  705. package/mobile/es6/exports/validatePhoneNumberLength.js +5 -5
  706. package/mobile/es6/exports/withMetadataArgument.js +12 -12
  707. package/mobile/es6/index.d.cts +2 -2
  708. package/mobile/es6/index.d.ts +2 -2
  709. package/mobile/es6/index.js +44 -44
  710. package/mobile/es6/package.json +12 -12
  711. package/mobile/examples/examples.mobile.json.d.cts +3 -3
  712. package/mobile/examples/examples.mobile.json.d.ts +3 -3
  713. package/mobile/examples/package.json +16 -16
  714. package/mobile/exports/AsYouType.js +11 -11
  715. package/mobile/exports/Metadata.js +11 -11
  716. package/mobile/exports/PhoneNumber.js +21 -21
  717. package/mobile/exports/PhoneNumberMatcher.js +11 -11
  718. package/mobile/exports/findNumbers.js +5 -5
  719. package/mobile/exports/findPhoneNumbersInText.js +5 -5
  720. package/mobile/exports/formatIncompletePhoneNumber.js +5 -5
  721. package/mobile/exports/getCountries.js +5 -5
  722. package/mobile/exports/getCountryCallingCode.js +5 -5
  723. package/mobile/exports/getExampleNumber.js +5 -5
  724. package/mobile/exports/getExtPrefix.js +5 -5
  725. package/mobile/exports/isPossiblePhoneNumber.js +5 -5
  726. package/mobile/exports/isSupportedCountry.js +5 -5
  727. package/mobile/exports/isValidPhoneNumber.js +5 -5
  728. package/mobile/exports/parsePhoneNumber.js +5 -5
  729. package/mobile/exports/parsePhoneNumberWithError.js +6 -6
  730. package/mobile/exports/searchNumbers.js +5 -5
  731. package/mobile/exports/searchPhoneNumbersInText.js +5 -5
  732. package/mobile/exports/validatePhoneNumberLength.js +5 -5
  733. package/mobile/exports/withMetadataArgument.js +8 -8
  734. package/mobile/index.cjs +113 -113
  735. package/mobile/index.cjs.js +118 -118
  736. package/mobile/index.d.cts +137 -137
  737. package/mobile/index.d.ts +137 -137
  738. package/mobile/index.js +44 -44
  739. package/mobile/metadata/metadata.mobile.json +1 -1
  740. package/mobile/metadata/metadata.mobile.json.d.cts +4 -4
  741. package/mobile/metadata/metadata.mobile.json.d.ts +4 -4
  742. package/mobile/metadata/metadata.mobile.json.js +1 -1
  743. package/mobile/metadata/package.json +16 -16
  744. package/mobile/package.json +14 -14
  745. package/package.json +202 -202
  746. package/source/AsYouType.js +539 -539
  747. package/source/AsYouTypeFormatter.PatternMatcher.d.ts +66 -66
  748. package/source/AsYouTypeFormatter.PatternMatcher.js +196 -196
  749. package/source/AsYouTypeFormatter.PatternParser.d.ts +58 -58
  750. package/source/AsYouTypeFormatter.PatternParser.js +213 -213
  751. package/source/AsYouTypeFormatter.complete.js +134 -134
  752. package/source/AsYouTypeFormatter.js +713 -713
  753. package/source/AsYouTypeFormatter.util.js +99 -99
  754. package/source/AsYouTypeParser.js +519 -519
  755. package/source/AsYouTypeState.js +123 -123
  756. package/source/ParseError.js +13 -13
  757. package/source/PhoneNumber.js +161 -161
  758. package/source/PhoneNumberMatcher.js +398 -398
  759. package/source/constants.js +30 -30
  760. package/source/findNumbers/LRUCache.js +106 -106
  761. package/source/findNumbers/Leniency.js +407 -407
  762. package/source/findNumbers/RegExpCache.js +19 -19
  763. package/source/findNumbers/isValidCandidate.js +85 -85
  764. package/source/findNumbers/isValidPreCandidate.js +28 -28
  765. package/source/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js +63 -63
  766. package/source/findNumbers/parsePreCandidate.js +18 -18
  767. package/source/findNumbers/utf-8.js +81 -81
  768. package/source/findNumbers/util.js +33 -33
  769. package/source/findPhoneNumbersInText.js +11 -11
  770. package/source/format.js +235 -235
  771. package/source/formatIncompletePhoneNumber.js +16 -16
  772. package/source/formatPhoneNumberForMobileDialing.js +224 -224
  773. package/source/getCountries.js +4 -4
  774. package/source/getCountryCallingCode.js +1 -1
  775. package/source/getExampleNumber.js +6 -6
  776. package/source/helpers/RFC3966.js +58 -58
  777. package/source/helpers/applyInternationalSeparatorStyle.js +34 -34
  778. package/source/helpers/checkNumberLength.js +133 -133
  779. package/source/helpers/extension/createExtensionPattern.js +111 -111
  780. package/source/helpers/extension/extractExtension.js +28 -28
  781. package/source/helpers/extractCountryCallingCode.js +160 -160
  782. package/source/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +83 -83
  783. package/source/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +73 -73
  784. package/source/helpers/extractNationalNumber.js +123 -123
  785. package/source/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +103 -103
  786. package/source/helpers/extractPhoneContext.js +102 -102
  787. package/source/helpers/formatNationalNumberUsingFormat.js +45 -45
  788. package/source/helpers/getCountryAndCallingCodeFromOneOfThem.js +30 -30
  789. package/source/helpers/getCountryByCallingCode.js +32 -32
  790. package/source/helpers/getCountryByNationalNumber.js +75 -75
  791. package/source/helpers/getIddPrefix.js +25 -25
  792. package/source/helpers/getNumberType.js +101 -101
  793. package/source/helpers/getPossibleCountriesForNumber.js +24 -24
  794. package/source/helpers/isCallingCode.js +5 -5
  795. package/source/helpers/isCountryCode.js +5 -5
  796. package/source/helpers/isObject.js +5 -5
  797. package/source/helpers/isViablePhoneNumber.js +107 -107
  798. package/source/helpers/matchesEntirely.js +10 -10
  799. package/source/helpers/mergeArrays.js +23 -23
  800. package/source/helpers/parseDigits.js +81 -81
  801. package/source/helpers/stripIddPrefix.js +35 -35
  802. package/source/isPossible.js +84 -84
  803. package/source/isPossiblePhoneNumber.js +11 -11
  804. package/source/isValid.js +58 -58
  805. package/source/isValidPhoneNumber.js +11 -11
  806. package/source/legacy/PhoneNumberSearch.js +121 -121
  807. package/source/legacy/findNumbers.js +11 -11
  808. package/source/legacy/findPhoneNumbers.js +19 -19
  809. package/source/legacy/findPhoneNumbersInitialImplementation.js +81 -81
  810. package/source/legacy/format.js +116 -116
  811. package/source/legacy/getNumberType.js +120 -120
  812. package/source/legacy/isPossibleNumber.js +24 -24
  813. package/source/legacy/isValidNumber.js +11 -11
  814. package/source/legacy/isValidNumberForRegion.js +61 -61
  815. package/source/legacy/isValidNumberForRegion_.js +12 -12
  816. package/source/legacy/parse.js +6 -6
  817. package/source/legacy/searchNumbers.js +30 -30
  818. package/source/metadata.js +580 -580
  819. package/source/normalizeArguments.js +54 -54
  820. package/source/parse.js +403 -403
  821. package/source/parseIncompletePhoneNumber.js +68 -68
  822. package/source/parsePhoneNumber.js +7 -7
  823. package/source/parsePhoneNumberWithError.js +6 -6
  824. package/source/parsePhoneNumberWithError_.js +4 -4
  825. package/source/parsePhoneNumber_.js +24 -24
  826. package/source/searchPhoneNumbersInText.js +23 -23
  827. package/source/tools/semver-compare.js +25 -25
  828. package/source/validatePhoneNumberLength.js +30 -30
  829. package/types.d.cts +181 -181
  830. package/types.d.ts +181 -181
package/CHANGELOG.md CHANGED
@@ -1,972 +1,985 @@
1
- <!-- (breaking change) `parsePhoneNumberFromString()`: `extract: false` is now the default mode: non-phone-number characters aren't now trimmed on the left and on the right sides of a phone number. For example, `(213) 373-4253` is parsed as a valid phone number, but `Call: (213) 373-4253` is not, because `Call: ` doesn't automatically get trimmed now. For the old behavior, pass `extract: true` option. -->
2
-
3
- <!-- Maybe rename `metadata.full.json` -> `metadata.max.json`. -->
4
-
5
- <!-- (breaking change) Moved `findPhoneNumbersInText()` to its own subpackage: `libphonenumber-js/find`. The default export is `searchPhoneNumbersInText()` that returns an ES6 "iterator". -->
6
-
7
- <!-- Renamed source files: `parsePhoneNumber.js` -> `parsePhoneNumberWithError.js`, etc. -->
8
-
9
- <!-- (breaking change) Metadata is often updated, so it has been extracted into its own package: `libphonenumber-metadata`. -->
10
-
11
- <!-- `metadata.json` is now included in the package. -->
12
-
13
- <!-- (breaking change) `parseNumber()` is now `extended: true` by default (and the `extended` flag is no longer supported) meaning that by default it will parse all even remotely hypothetical phone numbers (this was decided to be the primary use case for this function, and it's how Google's libphonenumber does it). Pass `strict: true` flag for the old "only parse valid numbers" behaviour. -->
14
-
15
- <!-- (breaking change) `formatNumber()` no longer supports `formatNumber(numberString, countryString, format)` notation, use `formatNumber({ phone, country }, format)` notation instead. -->
16
-
17
- <!-- `type` parameter has been added to `isValidNumber()` for validating phone numbers of a particual type (fixed line, mobile, etc). -->
18
-
19
- <!-- (breaking change) Replaced `phone: ...` with `number: ...` in returned objects and arguments in all functions: `formatNumber()`, `parseNumber()`, `isValidNumber()`, `getNumberType()`, `findPhoneNumbers()`. -->
20
-
21
- <!-- (breaking change) Removed deprecated `findPhoneNumbers()`, `searchPhoneNumbers()` and `PhoneNumberSearch` functions. Use `findNumbers()`, `searchNumbers()` and `PhoneNumberMatcher` instead. -->
22
-
23
- <!-- (breaking change) Better API.
24
-
25
- https://github.com/catamphetamine/libphonenumber-js/issues/259
26
-
27
- Maybe something like:
28
-
29
- const number = parseNumber(value)
30
-
31
- const {
32
- number,
33
- country,
34
- nationalNumber,
35
- carrierCode,
36
- countryCallingCode,
37
- valid,
38
- possible
39
- } = parseNumber(value, { extended: true })
40
-
41
- // Maybe rename "extended" to something else.
42
- -->
43
-
44
- <!-- (breaking change)
45
- `phone` property of phone number object renamed to `nationalNumber`
46
- -->
47
-
48
- <!-- (breaking change) `examples.mobile.json` now provides phone numbers in E.164 format (e.g. `+78005553535`). Previously those numbers were in "national (significant) number" form (e.g. `8005553535`).
49
- -->
50
-
51
- <!-- (breaking change) AsYouType -> AsYouTypeFormatter (maybe, or maybe not). -->
52
-
53
- <!-- (breaking change) parse.js -> parseNumber.js, format.js -> formatNumber.js, validate.js -> isValidNumber.js. -->
54
-
55
- <!-- (breaking change) `findNumbers()` now returns an array of `PhoneNumber` objects instead of objects having shape `{ country, phone }`. -->
56
-
57
- <!-- (breaking change) Maybe change metadata from `.json` to `.js` to save size on `,0,` -> `,,`. -->
58
-
59
- <!-- (breaking change) Prepend `+` in AsYouType if no `defaultCountry` has been set.
60
-
61
- And edit the README:
62
-
63
- * `getNumber()` — Returns the [`PhoneNumber`](#phonenumber). Will return `undefined` if no [national (significant) number](#national-significant-number) has been entered so far, or if no `defaultCountry` has been set and the user enters a phone number not in international format.
64
- -->
65
-
66
- <!-- (breaking change) Changed `countries` and `country_calling_codes` properties in metadata: now they're not properties but rather elements of an array (`countries` is an array now rather than an object; `countries` is `metadata[0]` and `country_calling_codes` is `metadata[1]`). If you were using a custom-generated metadata then it has to be re-generated for the new version. -->
67
-
68
- <!-- This changelog [only](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/16#note_594165443) mentions the changes in the code. See [Google's changelog](https://github.com/google/libphonenumber/blob/master/release_notes.txt) for metadata changes. -->
69
-
70
- <!-- CHANGELOG START -->
71
-
72
- 1.13.7 / 18.6.2026
73
- ===================
74
-
75
- * Updated metadata to version 9.0.33:
76
- - Updated phone metadata for region code(s):
77
- BF, KE, MC, MW, NO, SG, SI, UG, VN
78
- - Updated geocoding data for country calling code(s): 47 (en)
79
- - Updated carrier data for country calling code(s):
80
- 36 (en), 40 (en), 65 (en), 84 (en), 232 (en), 235 (en), 250 (en), 256 (en),
81
- 265 (en), 386 (en), 503 (en), 1868 (en)
82
-
83
- 1.13.6 / 5.6.2026
84
- ===================
85
-
86
- * Updated metadata to version 9.0.32:
87
- - Updated phone metadata for region code(s): DZ, JP, NO, SJ, SO, UG
88
- - Updated carrier data for country calling code(s):
89
- 33 (en), 47 (en), 233 (en), 252 (en), 256 (en)
90
-
91
- 1.13.5 / 03.06.2026
92
- ===================
93
-
94
- * Converted any "tagged" types [back](https://gitlab.com/catamphetamine/libphonenumber-js/-/work_items/144#note_3415397139) to simple strings. Originally, some developers lobbied the use of so-called ["tagged"](https://medium.com/@ethanresnick/advanced-typescript-tagged-types-for-fewer-bugs-and-better-security-24db681d5721) types in this package in order to return more "strict" values. My knowledge of TypeScript at that time was limited to just its title, so I naturally succumbed to that influence and merged whatever changes seemed to be consensual between the participants in the issue discussions. Now though I can see how the concept of "tagged" types is redundant and adds nothing, so I decided to revert any "tagged" types back to simple strings.
95
-
96
- 1.13.3 / 22.5.2026
97
- ===================
98
-
99
- * Updated metadata to version 9.0.31:
100
- - Updated alternate formatting data for country calling code(s): 84
101
- - Updated phone metadata for region code(s):
102
- AI, BO, DZ, ET, GE, GM, IN, TR, UG, VN
103
- - Updated short number metadata for region code(s): IT
104
- - Updated geocoding data for country calling code(s): 213 (en)
105
- - Updated carrier data for country calling code(s):
106
- 34 (en), 43 (en), 84 (en), 90 (en), 220 (en), 251 (en), 256 (en), 354 (en),
107
- 591 (en), 1264 (en)
108
-
109
- 1.13.0 / 08.05.2026
110
- ===================
111
-
112
- * Merged a [pull request](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/29) by [Matt d'Entremont](https://gitlab.com/mdentremont) that adds ES6-only versions of `min`/`max`/`mobile`/`core` exports.
113
-
114
- * The new exports are:
115
- * `min` — `libphonenumber-js/min/es6`
116
- * `max` — `libphonenumber-js/max/es6`
117
- * `mobile` — `libphonenumber-js/mobile/es6`
118
- * "custom" — `libphonenumber-js/core/es6`
119
-
120
- * The bundle size reduction is roughly `37 KB` raw and `3.8-4.1 KB` gzipped.
121
-
122
- ```
123
- | legacy raw | modern raw | legacy gzip | modern gzip
124
- min | 177,666 B | 140,563 B | 42,081 B | 38,223 B
125
- max | 251,327 B | 214,224 B | 62,690 B | 58,750 B
126
- mobile | 193,117 B | 156,014 B | 46,712 B | 42,682 B
127
- core | 93,076 B | 56,158 B | 22,308 B | 18,223 B
128
- ```
129
-
130
- * Updated `libphonenumber-metadata-generator` package. No functional changes, just cosmetics: renamed some API methods and parameters.
131
-
132
- * (TypeScript) Added a new exported type `PhoneNumberType`, which is same as the old exported `NumberType` type (which is now considered deprecated) except for `undefined` value.
133
-
134
- * (TypeScript) Added comments and absent properties in `MetadataJson` interface.
135
-
136
- 1.12.43 / 07.05.2026
137
- ===================
138
-
139
- * Updated metadata to version 9.0.30:
140
- - Updated alternate formatting data for country calling code(s): 91
141
- - Updated phone metadata for region code(s): CL, CZ, DE, IN, SG
142
- - Updated geocoding data for country calling code(s): 91 (en)
143
- - Updated carrier data for country calling code(s):
144
- 56 (en), 65 (en), 91 (en), 594 (en), 596 (en), 855 (en)
145
-
146
- 1.12.42 / 23.4.2026
147
- ===================
148
-
149
- * Updated metadata to version 9.0.29:
150
- - Updated phone metadata for region code(s):
151
- BI, BL, GP, MF, MY, SK, TH, TR, TW
152
- - Updated short number metadata for region code(s): CH
153
- - New geocoding data for country calling code(s): 7 (kk)
154
- - Updated carrier data for country calling code(s):
155
- 7 (en, ru), 31 (en), 32 (en), 90 (en), 257 (en), 590 (en), 593 (en)
156
-
157
- 1.12.42 / 11.4.2026
158
- ===================
159
-
160
- * Updated metadata to version 9.0.28:
161
- - Updated phone metadata for region code(s): BW, IL, MN, RE, SR, YT
162
- - Updated carrier data for country calling code(s):
163
- 34 (en), 267 (en), 359 (en), 972 (en), 976 (en)
164
- - Updated / refreshed time zone meta data.
165
-
166
- 1.12.41 / 28.3.2026
167
- ===================
168
-
169
- * Updated metadata to version 9.0.27:
170
- - Updated phone metadata for region code(s):
171
- BF, BL, CM, GF, GH, GP, GU, KE, MF, MQ, MY, SX, TD, TJ, US
172
- - New geocoding data for country calling code(s): 1738 (en)
173
- - New carrier data for country calling code(s): 1721 (en)
174
- - Updated carrier data for country calling code(s):
175
- 60 (en), 599 (en), 992 (en)
176
- - Updated / refreshed time zone meta data.
177
-
178
- 1.12.40 / 13.3.2026
179
- ===================
180
-
181
- * Updated metadata to version 9.0.26:
182
- - Updated phone metadata for region code(s):
183
- BL, GF, GP, GY, KY, MF, PL, PM, VU
184
- - Updated short number metadata for region code(s): BL, GF, GP, GY, MF, PM
185
- - Updated geocoding data for country calling code(s): 48 (en)
186
- - Updated carrier data for country calling code(s):
187
- 33 (en), 44 (en), 229 (en), 591 (en), 1345 (en)
188
-
189
- 1.12.39 / 9.3.2026
190
- ===================
191
-
192
- * Updated metadata to version 9.0.25:
193
- - Updated alternate formatting data for country calling code(s): 90
194
- - Updated phone metadata for region code(s): 882, HK, MY, PA, SL, TG, TR
195
- - Updated short number metadata for region code(s): KR
196
- - New geocoding data for country calling code(s): 1728 (en)
197
- - Updated carrier data for country calling code(s):
198
- 33 (en), 44 (en), 55 (en), 60 (en), 81 (en), 90 (en), 228 (en), 232 (en),
199
- 420 (en), 852 (en, zh)
200
- - Updated / refreshed time zone meta data.
201
-
202
- 1.12.38 / 26.2.2026
203
- ===================
204
-
205
- * Updated metadata to version 9.0.25:
206
- - Updated alternate formatting data for country calling code(s): 90
207
- - Updated phone metadata for region code(s): 882, HK, MY, PA, SL, TG, TR
208
- - Updated short number metadata for region code(s): KR
209
- - New geocoding data for country calling code(s): 1728 (en)
210
- - Updated carrier data for country calling code(s):
211
- 33 (en), 44 (en), 55 (en), 60 (en), 81 (en), 90 (en), 228 (en), 232 (en),
212
- 420 (en), 852 (en, zh)
213
- - Updated / refreshed time zone meta data.
214
-
215
- 1.12.36 / 30.1.2026
216
- ===================
217
-
218
- * Updated metadata to version 9.0.23:
219
- - Updated alternate formatting data for country calling code(s): 595
220
- - Updated phone metadata for region code(s):
221
- AS, BE, CD, EH, GY, IR, JM, MA, MU, PY, SA, US
222
- - Updated short number metadata for region code(s): PY
223
- - Updated carrier data for country calling code(s):
224
- 98 (en, fa), 243 (en), 357 (en), 966 (en), 1658 (en)
225
-
226
- 1.12.35 / 14.1.2026
227
- ===================
228
-
229
- * Updated metadata to version 9.0.22:
230
- - Updated phone metadata for region code(s):
231
- AE, AG, AI, AS, BB, BM, BS, CA, DM, DO, GD, GU, HK, JM, KN, KR, KY, LC, MA,
232
- MP, MS, PR, SG, SX, TC, TT, UG, US, VC, VG, VI
233
- - Updated geocoding data for country calling code(s): 1305 (en)
234
- - Updated carrier data for country calling code(s):
235
- 33 (en), 34 (en), 39 (en), 41 (en), 65 (en), 81 (en), 255 (en), 256 (en),
236
- 852 (en, zh, zh_Hant), 971 (en)
237
-
238
- 1.12.33 / 18.12.2025
239
- ===================
240
-
241
- * Updated metadata to version 9.0.21:
242
- - Updated alternate formatting data for country calling code(s): 91
243
- - Updated phone metadata for region code(s):
244
- CL, EE, ET, GE, GY, HK, IN, KR, MG, SG, SV, US
245
- - New geocoding data for country calling code(s): 1353 (en)
246
- - Updated geocoding data for country calling code(s): 251 (en)
247
- - Updated carrier data for country calling code(s):
248
- 34 (en), 36 (en), 43 (en), 48 (en), 56 (en), 65 (en), 261 (en), 501 (en),
249
- 503 (en), 852 (en, zh)
250
- - Updated / refreshed time zone meta data.
251
-
252
- 1.12.32 / 5.12.2025
253
- ===================
254
-
255
- * Updated metadata to version 9.0.20:
256
- - Updated phone metadata for region code(s): GY, IL, MU, TD, TZ, UG, UZ
257
- - New geocoding data for country calling code(s): 229 (en)
258
- - Updated carrier data for country calling code(s):
259
- 34 (en), 230 (en), 255 (en), 256 (en), 998 (en)
260
-
261
- 1.12.31 / 02.12.2025
262
- ===================
263
-
264
- * Merged [Louis Boulagnon](https://gitlab.com/louisboulagnon)'s [fix](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/28): `parse('...') instanceof PhoneNumber` check now works correctly.
265
-
266
- 1.12.30 / 01.12.2025
267
- ===================
268
-
269
- * Merged [Endy Gower](https://gitlab.com/endycb)'s [fix](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/27): `findPhoneNumbersInText()` now correctly finds phone numbers that're separated by a `/` character. Example: `651-234-2345/332-445-1234`.
270
-
271
- 1.12.29 / 21.11.2025
272
- ===================
273
-
274
- * Updated metadata to version 9.0.19:
275
- - Updated phone metadata for region code(s):
276
- CF, EE, EH, GE, IN, LB, MA, OM, SG, SN, SV, UG
277
- - Updated geocoding data for country calling code(s):
278
- 61 (en), 91 (en), 212 (en)
279
- - Updated carrier data for country calling code(s):
280
- 34 (en), 45 (en), 65 (en), 91 (en), 236 (en), 256 (en), 503 (en), 961 (en),
281
- 995 (en)
282
-
283
- 1.12.26 / 7.11.2025
284
- ===================
285
-
286
- * Updated metadata to version 9.0.18:
287
- - Updated phone metadata for region code(s):
288
- AU, BJ, CC, CX, ET, IL, IR, MC, PY, QA, SG, SV, TJ, UG, ZA
289
- - Updated short number metadata for region code(s): PY
290
- - Updated geocoding data for country calling code(s): 61 (en)
291
- - Updated carrier data for country calling code(s):
292
- 61 (en), 65 (en), 98 (en, fa), 229 (en), 256 (en), 372 (en), 377 (en),
293
- 503 (en), 972 (en), 992 (en)
294
- - Updated / refreshed time zone meta data.
295
-
296
- 1.12.25 / 24.10.2025
297
- ===================
298
-
299
- * Updated metadata to version 9.0.17:
300
- - Updated phone metadata for region code(s): AU, CC, CX, GB, LB, MG, SN
301
- - Updated short number metadata for region code(s): RO
302
- - Updated carrier data for country calling code(s):
303
- 57 (en), 61 (en), 221 (en), 255 (en), 261 (en), 852 (zh), 961 (en)
304
- - Updated / refreshed time zone meta data.
305
-
306
- 1.12.24 / 10.10.2025
307
- ===================
308
-
309
- * Updated metadata to version 9.0.16:
310
- - Updated phone metadata for region code(s): CZ, ES, GE, HK, JO, LI, US
311
- - Updated short number metadata for region code(s): ES
312
- - New geocoding data for country calling code(s): 1324 (en)
313
- - Updated geocoding data for country calling code(s): 1437 (en)
314
- - Updated carrier data for country calling code(s):
315
- 34 (en), 65 (en), 233 (en), 423 (en), 673 (en), 852 (en, zh), 962 (en),
316
- 995 (en)
317
- - Updated / refreshed time zone meta data.
318
-
319
- 1.12.23 / 26.9.2025
320
- ===================
321
-
322
- * Updated metadata to version 9.0.15:
323
- - Updated phone metadata for region code(s): KE, UG, US
324
- - Updated short number metadata for region code(s): DE, ES
325
- - Updated carrier data for country calling code(s): 254 (en), 256 (en)
326
-
327
- 1.12.22 / 24.9.2025
328
- ===================
329
-
330
- * Updated metadata to version 9.0.14:
331
- - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
332
- - Updated short number metadata for region code(s): DE
333
- - New geocoding data for country calling code(s): 1686 (en)
334
- - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
335
- - Updated carrier data for country calling code(s):
336
- 46 (en), 65 (en), 420 (en), 998 (en)
337
- - Updated / refreshed time zone meta data.
338
-
339
- 1.12.21 / 23.9.2025
340
- ===================
341
-
342
- * Updated metadata to version 9.0.14:
343
- - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
344
- - Updated short number metadata for region code(s): DE
345
- - New geocoding data for country calling code(s): 1686 (en)
346
- - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
347
- - Updated carrier data for country calling code(s):
348
- 46 (en), 65 (en), 420 (en), 998 (en)
349
- - Updated / refreshed time zone meta data.
350
-
351
- 1.12.20 / 23.9.2025
352
- ===================
353
-
354
- * Updated metadata to version 9.0.14:
355
- - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
356
- - Updated short number metadata for region code(s): DE
357
- - New geocoding data for country calling code(s): 1686 (en)
358
- - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
359
- - Updated carrier data for country calling code(s):
360
- 46 (en), 65 (en), 420 (en), 998 (en)
361
- - Updated / refreshed time zone meta data.
362
-
363
- 1.12.19 / 23.9.2025
364
- ===================
365
-
366
- * Updated metadata to version 9.0.14:
367
- - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
368
- - Updated short number metadata for region code(s): DE
369
- - New geocoding data for country calling code(s): 1686 (en)
370
- - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
371
- - Updated carrier data for country calling code(s):
372
- 46 (en), 65 (en), 420 (en), 998 (en)
373
- - Updated / refreshed time zone meta data.
374
-
375
- 1.12.17 / 12.9.2025
376
- ===================
377
-
378
- * (miscellaneous) Updated metadata generator: fixed an error message when a developer attempts to generate custom metadata and the files are not found in Google's github repository.
379
-
380
- 1.12.16 / 11.9.2025
381
- ===================
382
-
383
- * Updated metadata to version 9.0.14:
384
- - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
385
- - Updated short number metadata for region code(s): DE
386
- - New geocoding data for country calling code(s): 1686 (en)
387
- - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
388
- - Updated carrier data for country calling code(s):
389
- 46 (en), 65 (en), 420 (en), 998 (en)
390
- - Updated / refreshed time zone meta data.
391
-
392
- 1.12.15 / 28.8.2025
393
- ===================
394
-
395
- * Updated metadata to version 9.0.13:
396
- - Updated phone metadata for region code(s):
397
- BT, DE, GY, IL, OM, PA, SG, SR, UY
398
- - Updated short number metadata for region code(s): UY
399
- - Updated geocoding data for country calling code(s): 975 (en)
400
- - Updated carrier data for country calling code(s):
401
- 30 (en), 41 (en), 46 (en), 49 (en), 65 (en), 86 (en, zh), 372 (en), 597 (en),
402
- 968 (en), 975 (en)
403
-
404
- 1.12.13 / 20.8.2025
405
- ===================
406
-
407
- * Updated metadata to version 9.0.12:
408
- - Updated phone metadata for region code(s): GB, GG, GM, GY, IM, JE
409
- - Updated geocoding data for country calling code(s): 61 (en), 81 (en, ja)
410
- - Updated carrier data for country calling code(s):
411
- 220 (en), 370 (en), 592 (en)
412
-
413
- 1.12.0 / 24.02.2025
414
- ===================
415
-
416
- * Added an export of `PhoneNumber` class, as suggested by [Jan Vincent Liwanag](https://gitlab.com/jvliwanag) in his [pull request](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/26).
417
-
418
- 1.11.0 / 06.05.2024
419
- ====================
420
-
421
- * (TypeScript) Fixed Tagged type to be more strict, as suggested in an [issue](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/144) by Islam Sharabash.
422
-
423
- 1.10.17 / 08.01.2023
424
- ==================
425
-
426
- * [Added](https://github.com/catamphetamine/libphonenumber-js/issues/420) `PhoneNumber.getPossibleCountries()` function. It returns a list of countries this phone number could possibly belong to. Can be used when parsing complete international phone numbers containing a "calling code" that is shared between several countries. If parsing such a phone number returns `country: undefined` then `getPossibleCountries()` function could be used to somehow speculate about what country could this phone number possibly belong to.
427
-
428
- 1.10.0 / 18.05.2022
429
- ==================
430
-
431
- * Migrated the library to use ["ES Modules" export](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/42). This shouldn't break anyone's code and it makes it more modern since people asked about this feature.
432
-
433
- 1.9.48 / 06.02.2022
434
- ==================
435
-
436
- * Merged a [pull request](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/8) that [changed the declaration](https://github.com/catamphetamine/libphonenumber-js/issues/170#issuecomment-1030821520) of basic "string" types like `E164Number`, `NationalNumber`, `Extension`, etc.
437
-
438
- 1.9.45 / xx.01.2022
439
- ==================
440
-
441
- * Added `AsYouType.getNumberValue()` function. The function will be [used](https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/113) in `react-phone-number-input` component. Returns the phone number in [`E.164`](https://en.wikipedia.org/wiki/E.164) format. For example, for country `"US"` and input `"(222) 333-4444"` it will return `"+12223334444"`. Will return `undefined` if no digits have been input, or when inputting a phone number in national format and no default country or default "country calling code" have been set.
442
-
443
- 1.9.42 / 05.11.2021
444
- ==================
445
-
446
- * Added a better called alias for `metadata.full.json` — `metadata.max.json`.
447
-
448
- 1.9.40 / 02.11.2021
449
- ==================
450
-
451
- * Improved [format selection](https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/93) in `AsYouType` formatter: previously it chose the first one before there were at least 3 national (significant) number digits, now it starts filtering out formats right from the start of the national (significant) number.
452
-
453
- 1.9.36 / 05.10.2021
454
- ==================
455
-
456
- * Added a [`setExt(ext: string)`](https://gitlab.com/catamphetamine/libphonenumber-js/#setextext-string) function of a `PhoneNumber` class instance. It could be useful when formatting phone numbers stored as two separate fields: the phone number itself and the extension part.
457
-
458
- 1.9.27 / 09.09.2021
459
- ==================
460
-
461
- * [Added](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/45) TypeScript "typings" on the exported `Metadata` class. Also rewrote `Metadata` class API [docs](https://gitlab.com/catamphetamine/libphonenumber-js#metadata) and the description of [`leading_digits`](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits) metadata property.
462
-
463
- * TypeScript `Metadata` exported type was renamed to `MetadataJson` so that the `Metadata` class type could be exported as `Metadata`.
464
-
465
- 1.9.26 / 05.09.2021
466
- ==================
467
-
468
- * [Added](https://github.com/catamphetamine/libphonenumber-js/issues/406) `validatePhoneNumberLength()` function: same as `isPossiblePhoneNumber()` but tells the actual reason why a phone number is not possible: `TOO_SHORT`, `TOO_LONG`, `INVALID_LENGTH`, etc.
469
-
470
- ```js
471
- validatePhoneNumberLength('abcde') === 'NOT_A_NUMBER'
472
- validatePhoneNumberLength('444 1 44') === 'INVALID_COUNTRY'
473
- validatePhoneNumberLength('444 1 44', 'TR') === 'TOO_SHORT'
474
- validatePhoneNumberLength('444 1 444', 'TR') === undefined
475
- validatePhoneNumberLength('444 1 4444', 'TR') === 'INVALID_LENGTH'
476
- validatePhoneNumberLength('444 1 44444', 'TR') === 'INVALID_LENGTH'
477
- validatePhoneNumberLength('444 1 444444', 'TR') === undefined
478
- validatePhoneNumberLength('444 1 4444444444', 'TR') === 'TOO_LONG'
479
- ```
480
-
481
- 1.9.20 / 07.06.2021
482
- ==================
483
-
484
- * [Changed](https://github.com/google/libphonenumber/commit/c6277266fba8223cfc610cfb1e999deb9f876d65) formatting numbers in `IDD` format to always use the preferred IDD prefix (if defined), not just in cases when a country has multiple IDD prefixes. This means that it will output `8~10` as the prefix instead of `810` for some regions (like Uzbekistan) that have this tilde in their IDD prefix (the tilde designates that the user should wait before continuing to dial).
485
-
486
- 1.9.11 / 10.02.2021
487
- ==================
488
-
489
- * [Added](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/29) `extract: false` option on `parsePhoneNumberFromString()`: it enables a bit "stricter" parsing in a way that it attempts to parse the entire text as a phone number rather than extracting a phone number from text. For example, with `extract: false` option, `"(213) 373-4253"` is parsed as a valid phone number, but `"Call: (213) 373-4253"` is not, because the `"Call: "` part doesn't automatically get trimmed in this case. If there's version `2.x`, I guess `extract: false` will be the default behavior because it looks more appropriate than the default "extract" behavior of Google's `libphonenumber`.
490
-
491
- * Added `isPossiblePhoneNumber()` and `isValidPhoneNumber()` functions, which are basically shortucts to `parsePhoneNumberFromString(text, { extract: false })` and then `.isValid()`/`.isPossible()`.
492
-
493
- 1.9.5 / 01.12.2020
494
- ==================
495
-
496
- * Fixed the [issue](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/4) with `findPhoneNumbersInText()` returning incorrect `startAt` and `endsAt` positions in some cases.
497
-
498
- 1.9.4 / 13.11.2020
499
- ==================
500
-
501
- * Refactored the main ES6 export in order to support "tree shaking".
502
-
503
- 1.9.3 / 11.11.2020
504
- ==================
505
-
506
- * Added `AsYouType.getChars()` method.
507
-
508
- * Added formatting of international phone numbers that have been input without a leading `+`.
509
-
510
- 1.9.2 / 08.11.2020
511
- ==================
512
-
513
- * Metadata `version` is now an integer instead of a semver version. Semver versions of previously generated metadata are automatically converted into an integer version.
514
-
515
- 1.9.1 / 08.11.2020
516
- ==================
517
-
518
- * Merged the latest Google's [patch](https://github.com/google/libphonenumber/commit/55b2646ec9393f4d3d6661b9c82ef9e258e8b829) on parsing phone number extensions.
519
-
520
- 1.9.0 / 08.11.2020
521
- ==================
522
-
523
- * Refactored `AsYouType` formatter.
524
-
525
- * (could be a breaking change for some) Some people might have used some of the _undocumented_ `AsYouType` instance properties like `.countryCallingCode`, `.nationalNumber`, etc: those have been moved to a new `.state` object. The `.state` object is also not part of the public API, so developers shouldn't use it: use the documented getter methods instead. The `.country` property of `AsYouType` instance still stays: not because it hasn't been moved (it has been and is emulated), but because it has been part of an official (now legacy) API of `AsYouType` formatter.
526
-
527
- * (misc) Renamed `asYouType` instance method `getCountryCallingCode()` to `getCountryCode()`. The older name still works.
528
-
529
- * (could be a _build-time_ breaking change for custom metadata) For those who were generating custom metadata, the `libphonenumber-generate-metadata` console command has been moved to a separate package called `libphonenumber-metadata-generator`. The applications that're using it should do `npm install libphonenumber-metadata-generator --save-dev` and then use the new `libphonenumber-metadata-generator` command instead of the old one (only the name changed). [See instructions](https://gitlab.com/catamphetamine/libphonenumber-metadata-generator).
530
-
531
- 1.8.6 / 05.11.2020
532
- ==================
533
-
534
- * Refactored `AsYouType` formatter.
535
-
536
- * [Fixed](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/23) `AsYouType` formatter not formatting numbers in some cases like, for example, certain types of Argentinian mobile numbers.
537
-
538
- <!-- * Found out that all previous `metadata` was missing `domestic_carrier_code_formatting_rule` that is used in a few countries (like Argentina) when formatting phone numbers containing "carrier codes". It has been added now. -->
539
-
540
- * `humanReadable` option of `"IDD"` formatting has been removed: now it's always `true`. The rationale is that Google's `formatOutOfCountryCallingNumber()` original function always formats in "human readable" format.
541
-
542
- 1.8.3 / 03.10.2020
543
- ==================
544
-
545
- * (advanced) Fixed `metadata.mobile.json` and generating "custom" metadata: now it won't include non-relevant phone number types. Previously, `metadata.mobile.json` (and any other "custom"-generated metadata) included all phone number types for cases when there're several countries corresponding to the same country calling code (for example, `US` and `CA`). So, in case of `metadata.mobile.json`, for `DE` it only contained mobile phone number type, but for `US` and `CA` it contained all phone number types (this has been unnoticed until this release). Now it only contains mobile phone number types for any country, as it's supposed to be. This change didn't result in any significant "mobile" metadata size reduction: just `105 KB` -> `95 KB`.
546
-
547
- 1.8.1 / 23.09.2020
548
- ==================
549
-
550
- * Renamed `parsePhoneNumber()` named export to `parsePhoneNumberWithError()`. The older name still works.
551
-
552
- 1.8.0 / 22.09.2020
553
- ==================
554
-
555
- * Promoted `parsePhoneNumberFromString()` named export to a default export due to the name being too verbose.
556
-
557
- 1.7.50 / 05.04.2020
558
- ===================
559
-
560
- * [Added](https://github.com/catamphetamine/libphonenumber-js/issues/388#issuecomment-609036293) some utility functions to `AsYouType`:
561
-
562
- ```js
563
- /**
564
- * Returns `true` if the phone number is being input in international format.
565
- * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
566
- * @return {boolean}
567
- */
568
- isInternational()
569
-
570
- /**
571
- * Returns the "country calling code" part of the phone number.
572
- * Returns `undefined` if the number is not being input in international format.
573
- * Returns "country calling code" for "non-geographic" phone numbering plans too.
574
- * @return {string} [countryCallingCode]
575
- */
576
- getCountryCallingCode()
577
-
578
- /**
579
- * Returns a two-letter country code of the phone number.
580
- * Returns `undefined` for "non-geographic" phone numbering plans.
581
- * Returns `undefined` if no phone number has been input yet.
582
- * @return {string} [country]
583
- */
584
- getCountry()
585
-
586
- /**
587
- * Returns `true` if the phone number is "possible".
588
- * Is just a shortcut for `PhoneNumber.isPossible()`.
589
- * @return {boolean}
590
- */
591
- isPossible()
592
-
593
- /**
594
- * Returns `true` if the phone number is "valid".
595
- * Is just a shortcut for `PhoneNumber.isValid()`.
596
- * @return {boolean}
597
- */
598
- isValid()
599
- ```
600
-
601
- 1.7.38 / 04.02.2020
602
- ===================
603
-
604
- * Removed the `"001"` country code ("Non-Geographic Entity"): now in case of "non-geographic" phone numbers their `country` is just `undefined`. Instead, `PhoneNumber` class has an `.isNonGeographic()` method.
605
-
606
- * Fixed "non-geographic" numbers `.isPossible() === false` bug.
607
-
608
- 1.7.35 / 03.02.2020
609
- ===================
610
-
611
- * Fixed "Non-Geographic Entities" (`001` country code).
612
-
613
- 1.7.32 / 03.02.2020
614
- ===================
615
-
616
- * Refactored the code. Mostly `AsYouType` formatter. `AsYouType.input()` no longer accepts "falsy" values like `null`: instead, it only accepts strings.
617
-
618
- * Fixed `AsYouType` formatter bugs ([#318](https://github.com/catamphetamine/libphonenumber-js/issues/318)).
619
-
620
- * Added `nationalPrefix: boolean` option to `PhoneNumber.format()` — Some phone numbers can be formatted both with national prefix and without it. In such cases the library defaults to "with national prefix" (for legacy reasons). Pass `nationalPrefix: false` option to force formatting without national prefix in such cases.
621
-
622
- * Renamed `findNumbers(text, { v2: true })` to `findPhoneNumbersInText(text)`, and `searchNumbers(text, { v2: true })` to `searchPhoneNumbersInText(text)`.
623
-
624
- 1.7.27 / 18.11.2019
625
- ===================
626
-
627
- * Added `getCountries()` function that returns a list of all available two-letter country codes. This is to prevent some users from having to deal with `Unknown country` error.
628
-
629
- 1.7.6 / 11.01.2019
630
- ==================
631
-
632
- * `findNumbers()`, `searchNumbers()`, `PhoneNumberMatcher` don't throw "Unknown country" error anymore: a non-existent country is simply ignored instead. Same goes for `getExampleNumber()` and `getExtPrefix()`.
633
-
634
- * `parsePhoneNumberFromString()` doesn't return `undefined` if a non-existent default country is passed: it simply ignores such country instead and still parses international numbers.
635
-
636
- * Added `isSupportedCountry(country)` function.
637
-
638
- * Added CDN bundles for `min`/`max`/`mobile` sub-packages.
639
-
640
- * Moved demo to `max` metadata (was `min` previously).
641
-
642
- * Added TypeScript definitions for `min`/`max`/`mobile`/`core` sub-packages.
643
-
644
- 1.7.1 / 01.12.2018
645
- ==================
646
-
647
- * Added `/min`, `/max`, `/mobile` and `/custom` subpackages pre-wired with different flavors of metadata. See the relevant readme section for more info.
648
-
649
- * Added `parsePhoneNumberFromString()` function (which doesn't throw but instead returns `undefined`).
650
-
651
- 1.7.0 / 31.12.2018
652
- ==================
653
-
654
- * Refactored the code to remove cyclic dependencies which caused warnings on React Native. It's not a breaking change but it's still a big code diff overall so incremented the "minor" version number.
655
-
656
- 1.6.2 / 18.10.2018
657
- ==================
658
-
659
- * Support Russian extension character "доб" as a valid one while parsing the numbers.
660
-
661
- 1.6.1 / 18.10.2018
662
- ==================
663
-
664
- * Added `.getNumber()` method to `AsYouType` formatter instance. Returns a `PhoneNumber`.
665
-
666
- 1.6.0 / 17.10.2018
667
- ==================
668
-
669
- * Added `parsePhoneNumber()` function and `PhoneNumber` class.
670
-
671
- * Added `v2: true` option to `findNumbers()` function.
672
-
673
- * Added `getExampleNumber()` function.
674
-
675
- * Added `isPossibleNumber()` function.
676
-
677
- * In `formatNumber()` renamed `National` to `NATIONAL` and `International` to `INTERNATIONAL`. The older variants still work but are considered deprecated.
678
-
679
- * (metadata file internal format breaking change) (doesn't affect users of this library) If anyone was using metadata files from this library bypassing the library functions (i.e. those who parsed `metadata.min.json` file manually) then there's a new internal optimization introduced in this version: previously `formats` were copy-pasted for each country of the same region (e.g. `NANPA`) while now the `formats` are only defined on the "main" country for region and other countries simply read the `formats` from it at runtime. This reduced the default metadata file size by 5 kilobytes.
680
-
681
- 1.5.0 / 26.09.2018
682
- ==================
683
-
684
- * Deprecated `findPhoneNumbers()`, `searchPhoneNumbers()` and `PhoneNumberSearch`. Use `findNumbers()`, `searchNumbers()` and `PhoneNumberMatcher` instead. The now-deprecated functions were a half-self-made implementation of Google's Java `findNumbers()` until the Java code was ported into javascript and passed tests. The port of Google's Java implementation is supposed to find numbers more correctly. It hasn't been tested by users in production yet, but the same tests as for the previous implementation of `findPhoneNumbers()` pass, so seems that it can be used in production.
685
-
686
- 1.4.6 / 12.09.2018
687
- ==================
688
-
689
- * Fixed `formatNumber('NATIONAL')` not formatting national phone numbers with a national prefix when it's marked as optional (e.g. Russia). Before it didn't add national prefix when formatting national numbers if national prefix was marked as optional. Now it always adds national prefix when formatting national numbers even when national prefix is marked as optional.
690
-
691
- 1.4.5 / 07.09.2018
692
- ==================
693
-
694
- * A bug in `matches_entirely` was found by a user which resulted in incorrect regexp matching in some cases, e.g. when there was a `|` in a regexp. This could cause incorrect `parseNumber()` results, or any other weird behaviour.
695
-
696
- 1.4.0 / 03.08.2018
697
- ==================
698
-
699
- * Changed the output of `AsYouType` formatter. E.g. before for `US` and input `21` it was outputting `(21 )` which is not good for phone number input (not intuitive and is confusing). Now it will not add closing braces which haven't been reached yet by the input cursor and it will also strip the corresponding opening braces, so for `US` and input `21` it now is just `21`, and for `213` it is `(213)`.
700
-
701
- * (could be a breaking change for those who somehow used `.template` property of an `AsYouType` instance) Due to the change in `AsYouType` formatting the `.template` property no longer strictly corresponds to the output, e.g. for `US` and input `21` the output is now `21` but the `.template` is still `(xxx) xxx-xxxx` like it used to be in the older versions when the output was `(21 )`. Therefore, a new function has been added to `AsYouType` instance called `.getTemplate()` which will return the _partial_ template for the currently input value, so for input `21` the output will be `21` and `.getTemplate()` will return `xx`, and for input `213` the output will be `(213)` and `.getTemplate()` will return `(xxx)`. So there is this difference between the new `.getTemplate()` function and the old `.template` property: the old `.template` property always returns the template for a fully entered phone number and the new `.getTemplate()` function always returns the template for the _partially_ entered phone number, i.e. for the partially entered number `(213) 45` it will return template `(xxx) xx` so it's a one-to-one correspondence now.
702
-
703
- 1.3.0 / 25.07.2018
704
- ==================
705
-
706
- * Fixed `parseNumber()`, `isValidNumber()` and `getNumberType()` in some rare cases (made them a bit less strict where it fits): previously they were treating `defaultCountry` argument as "the country" in case of local numbers, e.g. `isValidNumber('07624 369230', 'GB')` would be `false` because `07624 369230` number belongs to `IM` (the Isle of Man). While `IM` is not `GB` it should still be `true` because `GB` is the _default_ country, without it necessarily being _the_ country.
707
-
708
- * Added a new function `isValidNumberForRegion(number, country)` which mimics [Google's `libphonenumber`'s one](https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion).
709
-
710
- 1.2.13 / 30.05.2018
711
- ===================
712
-
713
- * Fixed a previously unnoticed [bug](https://github.com/catamphetamine/libphonenumber-js/issues/217) regarding parsing RFC3966 phone URIs: previously `:` was mistakenly being considered a key-value separator instead of `=`. E.g. it was parsing RFC3966 phone numbers as `tel:+78005553535;ext:123` instead of `tel:+78005553535;ext=123`. The bug was found and reported by @cdunn.
714
-
715
- 1.2.6 / 12.05.2018
716
- ===================
717
-
718
- * Removed `parseNumber()`'s `fromCountry` parameter used for parsing IDD prefixes: now it uses `defaultCountry` instead. `formatNumber()`'s `fromCountry` parameter stays and is not removed.
719
-
720
- 1.2.5 / 11.05.2018
721
- ===================
722
-
723
- * Optimized metadata a bit: using `0` instead of `null`/`false` and `1` instead of `true`.
724
-
725
- 1.2.0 / 08.05.2018
726
- ===================
727
-
728
- * Added support for [IDD prefixes](https://en.wikipedia.org/wiki/International_direct_dialing) — `parse()` now parses IDD-prefixed phones if `fromCountry` option is passed, `format()` now has an `IDD` format.
729
-
730
- 1.1.7 / 01.04.2018
731
- ===================
732
-
733
- * Added `parseNumber()` and `formatNumber()` aliases for `parse()` and `format()`. Now these are the default ones, and `parse()` and `format()` names are considered deprecated. The rationale is that `parse()` and `format()` function names are too unspecific and can clash with other functions declared in a javascript file. And also searching in a project for `parseNumber` and `formatNumber` is easier than searching in a project for `parse` and `format`.
734
-
735
- * Fixed `parseRFC3966()` and `formatRFC3966()` non-custom exports.
736
-
737
- 1.1.4 / 15.03.2018
738
- ===================
739
-
740
- * `parse()` is now more forgiving when parsing invalid international numbers. E.g. `parse('+49(0)15123020522', 'DE')` doesn't return `{}` and instead removes the invalid `(0)` national prefix from the number.
741
-
742
- 1.1.1 / 10.03.2018
743
- ===================
744
-
745
- * Added `PhoneNumberSearch` class for asynchronous phone number search.
746
-
747
- 1.1.0 / 09.03.2018
748
- ===================
749
-
750
- * Added `findPhoneNumbers` function.
751
-
752
- 1.0.22 / 13.02.2018
753
- ===================
754
-
755
- * Added `parseRFC3966` and `formatRFC3966` functions which are exported.
756
-
757
- 1.0.18 / 12.02.2018
758
- ===================
759
-
760
- * Fixed custom metadata backwards compatibility [bug](https://github.com/catamphetamine/libphonenumber-js/issues/180) introduced in `1.0.16`. All people who previously installed `1.0.16` or `1.0.17` should update.
761
- * Refactored metadata module which now supports versioning by adding the `version` property to metadata JSON.
762
-
763
- 1.0.17 / 07.02.2018
764
- ===================
765
-
766
- * Fixed `RFC3966` format not prepending `tel:` to the output.
767
- * Renamed `{ possible: true }` option to `{ extended: true }` and the result is now more verbose (see the README).
768
- * Added `possible_lengths` property in metadata: metadata generated using previous versions of the library should be re-generated with then new version.
769
-
770
- 1.0.16 / 07.02.2018
771
- ===================
772
-
773
- * (experimental) Added `{ possible: true }` option for `parse()` for parsing "possible numbers" which are not considered valid (like Google's demo does). E.g. `parse('+71111111111', { possible: true }) === { countryCallingCode: '7', phone: '1111111111', possible: true }` and `format({ countryCallingCode: '7', phone: '1111111111' }, 'E.164') === '+71111111111'`.
774
- * `getPhoneCode` name is deprecated, use `getCountryCallingCode` instead.
775
- * `getPhoneCodeCustom` name is deprecated, use `getCountryCallingCodeCustom` instead.
776
- * `AsYouType.country_phone_code` renamed to `AsYouType.countryCallingCode` (but no one should have used that property).
777
-
778
- 1.0.0 / 21.01.2018
779
- ==================
780
-
781
- * If `country: string` argument is passed to `parse()` now it becomes "the default country" rather than "restrict to country" ("restrict to country" option is gone).
782
- * `parse()` `options` argument changed: it's now an undocumented feature and can have only a single option inside — `defaultCountry: string` — which should be passed as a string argument instead.
783
- * Removed all previously deprecated stuff: all underscored exports (`is_valid_number`, `get_number_type` and `as_you_type`), lowercase exports for `asYouType` and `asYouTypeCustom` (use `AsYouType` and `AsYouTypeCustom` instead), `"International_plaintext"` format (use `"E.164"` instead).
784
- * Integer phone numbers no longer [get automatically converted to strings](https://github.com/googlei18n/libphonenumber/blob/master/FALSEHOODS.md).
785
- * `parse()`, `isValidNumber()`, `getNumberType()` and `format()` no longer accept `undefined` phone number argument: it must be either a string or a parsed number object having a string `phone` property.
786
-
787
- 0.4.52 / 21.01.2018
788
- ===================
789
-
790
- * Added `formatExtension(number, extension)` option to `format()`
791
-
792
- 0.4.50 / 20.01.2018
793
- ===================
794
-
795
- * Added support for phone number extensions.
796
- * `asYouType` name is deprecated, use `AsYouType` instead (same goes for `asYouTypeCustom`).
797
- * `is_valid_number`, `get_number_type` and `as_you_type` names are deprecated, use camelCased names instead.
798
- * `International_plaintext` format is deprecated, use `E.164` instead.
799
- * Added `RFC3966` format for phone number URIs (`tel:+1213334455;ext=123`).
800
-
801
- 0.4.2 / 30.03.2017
802
- ===================
803
-
804
- * Added missing `getNumberTypeCustom` es6 export
805
-
806
- 0.4.0 / 29.03.2017
807
- ===================
808
-
809
- * Removed `.valid` from "as you type" formatter because it wasn't reliable (gave false negatives). Use `isValidNumber(value)` for phone number validation instead.
810
-
811
- 0.3.11 / 07.03.2017
812
- ===================
813
-
814
- * Fixed a bug when "as you type" formatter incorrectly formatted the input using non-matching phone number formats
815
-
816
- 0.3.8 / 25.02.2017
817
- ===================
818
-
819
- * Loosened national prefix requirement when parsing (fixed certain Brazilian phone numbers parsing)
820
-
821
- 0.3.6 / 16.02.2017
822
- ===================
823
-
824
- * Added more strict validation to `isValidNumber`
825
- * Fixed CommonJS export for `getNumberType`
826
-
827
- 0.3.5 / 15.02.2017
828
- ===================
829
-
830
- * Now exporting `getNumberType` function
831
-
832
- 0.3.0 / 29.01.2017
833
- ===================
834
-
835
- * Removed `libphonenumber-js/custom.es6` exported file: now everything should be imported from the root package in ES6-capable bundlers (because tree-shaking actually works that way)
836
- * Now custom functions like `parse`, `format` and `isValidNumber` are not bound to custom metadata: it's passed as the last argument instead. And custom `asYouType` is now not a function — instead, `asYouType` constructor takes an additional `metadata` argument
837
-
838
- 0.2.29 / 12.01.2017
839
- ===================
840
-
841
- * Fixed `update-metadata` utility
842
-
843
- 0.2.26 / 02.01.2017
844
- ===================
845
-
846
- * Added national prefix check for `parse` and `isPhoneValid`
847
-
848
- 0.2.25 / 30.12.2016
849
- ===================
850
-
851
- * A bit more precise `valid` flag for "as you type" formatter
852
-
853
- 0.2.22 / 28.12.2016
854
- ===================
855
-
856
- * Added metadata update `bin` command for end users (see README)
857
- * Added the ability to include extra regular expressions for finer-grained phone number validation
858
-
859
- 0.2.20 / 28.12.2016
860
- ===================
861
-
862
- * Added the ability to use custom-countries generated metadata as a parameter for the functions exported from this library
863
-
864
- 0.2.19 / 25.12.2016
865
- ===================
866
-
867
- * Small fix for "as you type" to not prepend national prefix to the number being typed
868
-
869
- 0.2.13 / 23.12.2016
870
- ===================
871
-
872
- * Reset `default_country` for "as you type" if the input is an international phone number
873
-
874
- 0.2.12 / 23.12.2016
875
- ===================
876
-
877
- * (misc) Small fix for `format()` when the national number is `undefined`
878
-
879
- 0.2.10 / 23.12.2016
880
- ===================
881
-
882
- * Better "as you type" matching: when the national prefix is optional it now tries both variants — with the national prefix extracted and without
883
-
884
- 0.2.9 / 22.12.2016
885
- ===================
886
-
887
- * Exporting `metadata` and `getPhoneCode()`
888
-
889
- 0.2.6 / 22.12.2016
890
- ===================
891
-
892
- * Fixed a minor bug in "as you type" when a local phone number without national prefix got formatted with the national prefix
893
-
894
- 0.2.2 / 14.12.2016
895
- ===================
896
-
897
- * Fixed a bug when country couldn't be parsed from a phone number in most cases
898
-
899
- 0.2.1 / 10.12.2016
900
- ===================
901
-
902
- * Added `.country_phone_code` readable property to "as you type" formatter
903
-
904
- 0.2.0 / 02.12.2016
905
- ===================
906
-
907
- * "As you type" formatter's `country_code` argument is now `default_country_code`, and it doesn't restrict to the specified country anymore.
908
-
909
- 0.1.17 / 01.12.2016
910
- ===================
911
-
912
- * "As you type" formatter `template` fix for national prefixes (which weren't replaced with `x`-es)
913
-
914
- 0.1.16 / 01.12.2016
915
- ===================
916
-
917
- * "As you type" formatter now formats the whole input passed to the `.input()` function one at a time without splitting it into individual characters (which yields better performance)
918
-
919
- 0.1.14 / 01.12.2016
920
- ===================
921
-
922
- * Added `valid`, `country` and `template` fields to "as you type" instance
923
-
924
- 0.1.12 / 30.11.2016
925
- ===================
926
-
927
- * Managed to reduce metadata size by another 5 KiloBytes removing redundant (duplicate) phone number type regular expressions (because there's no "get phone type" API in this library).
928
-
929
- 0.1.11 / 30.11.2016
930
- ===================
931
-
932
- * Managed to reduce metadata size by 10 KiloBytes removing phone number type regular expressions when `leading_digits` are present.
933
-
934
- 0.1.10 / 30.11.2016
935
- ===================
936
-
937
- * Turned out those numerous bulky regular expressions (`<fixedLine/>`, `<mobile/>`, etc) are actually required to reliably infer country from country calling code and national phone number in cases where there are multiple countries assigned to the same country phone code (e.g. NANPA), so I've included those big regular expressions for those ambiguous cases which increased metadata size by 20 KiloBytes resulting in a total of 90 KiloBytes for the metadata.
938
-
939
- 0.1.9 / 30.11.2016
940
- ===================
941
-
942
- * Small fix for "as you type" formatter: replacing digit placeholders (punctuation spaces) with regular spaces in the output
943
-
944
- 0.1.8 / 29.11.2016
945
- ===================
946
-
947
- * Fixed a bug when national prefix `1` was present in "as you type" formatter for NANPA countries (while it shouldn't have been present)
948
-
949
- 0.1.7 / 29.11.2016
950
- ===================
951
-
952
- * (may be a breaking change) renamed `.clear()` to `.reset()` for "as you type" formatter
953
-
954
- 0.1.5 / 29.11.2016
955
- ===================
956
-
957
- * Better `asYouType` (better than Google's original "as you type" formatter)
958
-
959
- 0.1.0 / 28.11.2016
960
- ===================
961
-
962
- * Added `asYouType` and `isValidNumber`.
963
-
964
- 0.0.3 / 24.11.2016
965
- ===================
966
-
967
- * Added `format` function.
968
-
969
- 0.0.1 / 24.11.2016
970
- ===================
971
-
1
+ <!-- (breaking change) `parsePhoneNumberFromString()`: `extract: false` is now the default mode: non-phone-number characters aren't now trimmed on the left and on the right sides of a phone number. For example, `(213) 373-4253` is parsed as a valid phone number, but `Call: (213) 373-4253` is not, because `Call: ` doesn't automatically get trimmed now. For the old behavior, pass `extract: true` option. -->
2
+
3
+ <!-- Maybe rename `metadata.full.json` -> `metadata.max.json`. -->
4
+
5
+ <!-- (breaking change) Moved `findPhoneNumbersInText()` to its own subpackage: `libphonenumber-js/find`. The default export is `searchPhoneNumbersInText()` that returns an ES6 "iterator". -->
6
+
7
+ <!-- Renamed source files: `parsePhoneNumber.js` -> `parsePhoneNumberWithError.js`, etc. -->
8
+
9
+ <!-- (breaking change) Metadata is often updated, so it has been extracted into its own package: `libphonenumber-metadata`. -->
10
+
11
+ <!-- `metadata.json` is now included in the package. -->
12
+
13
+ <!-- (breaking change) `parseNumber()` is now `extended: true` by default (and the `extended` flag is no longer supported) meaning that by default it will parse all even remotely hypothetical phone numbers (this was decided to be the primary use case for this function, and it's how Google's libphonenumber does it). Pass `strict: true` flag for the old "only parse valid numbers" behaviour. -->
14
+
15
+ <!-- (breaking change) `formatNumber()` no longer supports `formatNumber(numberString, countryString, format)` notation, use `formatNumber({ phone, country }, format)` notation instead. -->
16
+
17
+ <!-- `type` parameter has been added to `isValidNumber()` for validating phone numbers of a particual type (fixed line, mobile, etc). -->
18
+
19
+ <!-- (breaking change) Replaced `phone: ...` with `number: ...` in returned objects and arguments in all functions: `formatNumber()`, `parseNumber()`, `isValidNumber()`, `getNumberType()`, `findPhoneNumbers()`. -->
20
+
21
+ <!-- (breaking change) Removed deprecated `findPhoneNumbers()`, `searchPhoneNumbers()` and `PhoneNumberSearch` functions. Use `findNumbers()`, `searchNumbers()` and `PhoneNumberMatcher` instead. -->
22
+
23
+ <!-- (breaking change) Better API.
24
+
25
+ https://github.com/catamphetamine/libphonenumber-js/issues/259
26
+
27
+ Maybe something like:
28
+
29
+ const number = parseNumber(value)
30
+
31
+ const {
32
+ number,
33
+ country,
34
+ nationalNumber,
35
+ carrierCode,
36
+ countryCallingCode,
37
+ valid,
38
+ possible
39
+ } = parseNumber(value, { extended: true })
40
+
41
+ // Maybe rename "extended" to something else.
42
+ -->
43
+
44
+ <!-- (breaking change)
45
+ `phone` property of phone number object renamed to `nationalNumber`
46
+ -->
47
+
48
+ <!-- (breaking change) `examples.mobile.json` now provides phone numbers in E.164 format (e.g. `+78005553535`). Previously those numbers were in "national (significant) number" form (e.g. `8005553535`).
49
+ -->
50
+
51
+ <!-- (breaking change) AsYouType -> AsYouTypeFormatter (maybe, or maybe not). -->
52
+
53
+ <!-- (breaking change) parse.js -> parseNumber.js, format.js -> formatNumber.js, validate.js -> isValidNumber.js. -->
54
+
55
+ <!-- (breaking change) `findNumbers()` now returns an array of `PhoneNumber` objects instead of objects having shape `{ country, phone }`. -->
56
+
57
+ <!-- (breaking change) Maybe change metadata from `.json` to `.js` to save size on `,0,` -> `,,`. -->
58
+
59
+ <!-- (breaking change) Prepend `+` in AsYouType if no `defaultCountry` has been set.
60
+
61
+ And edit the README:
62
+
63
+ * `getNumber()` — Returns the [`PhoneNumber`](#phonenumber). Will return `undefined` if no [national (significant) number](#national-significant-number) has been entered so far, or if no `defaultCountry` has been set and the user enters a phone number not in international format.
64
+ -->
65
+
66
+ <!-- (breaking change) Changed `countries` and `country_calling_codes` properties in metadata: now they're not properties but rather elements of an array (`countries` is an array now rather than an object; `countries` is `metadata[0]` and `country_calling_codes` is `metadata[1]`). If you were using a custom-generated metadata then it has to be re-generated for the new version. -->
67
+
68
+ <!-- This changelog [only](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/16#note_594165443) mentions the changes in the code. See [Google's changelog](https://github.com/google/libphonenumber/blob/master/release_notes.txt) for metadata changes. -->
69
+
70
+ <!-- CHANGELOG START -->
71
+
72
+ 1.13.8 / 3.7.2026
73
+ ===================
74
+
75
+ * Updated metadata to version 9.0.34:
76
+ - Updated alternate formatting data for country calling code(s): 34
77
+ - Updated phone metadata for region code(s):
78
+ CM, ES, GY, HN, MZ, SR, TM, TZ, US, UZ
79
+ - Updated geocoding data for country calling code(s): 504 (en)
80
+ - Updated carrier data for country calling code(s):
81
+ 46 (en), 255 (en), 258 (en), 352 (en), 381 (en), 592 (en), 597 (en),
82
+ 886 (en), 998 (en)
83
+ - Updated / refreshed time zone meta data.
84
+
85
+ 1.13.7 / 18.6.2026
86
+ ===================
87
+
88
+ * Updated metadata to version 9.0.33:
89
+ - Updated phone metadata for region code(s):
90
+ BF, KE, MC, MW, NO, SG, SI, UG, VN
91
+ - Updated geocoding data for country calling code(s): 47 (en)
92
+ - Updated carrier data for country calling code(s):
93
+ 36 (en), 40 (en), 65 (en), 84 (en), 232 (en), 235 (en), 250 (en), 256 (en),
94
+ 265 (en), 386 (en), 503 (en), 1868 (en)
95
+
96
+ 1.13.6 / 5.6.2026
97
+ ===================
98
+
99
+ * Updated metadata to version 9.0.32:
100
+ - Updated phone metadata for region code(s): DZ, JP, NO, SJ, SO, UG
101
+ - Updated carrier data for country calling code(s):
102
+ 33 (en), 47 (en), 233 (en), 252 (en), 256 (en)
103
+
104
+ 1.13.5 / 03.06.2026
105
+ ===================
106
+
107
+ * Converted any "tagged" types [back](https://gitlab.com/catamphetamine/libphonenumber-js/-/work_items/144#note_3415397139) to simple strings. Originally, some developers lobbied the use of so-called ["tagged"](https://medium.com/@ethanresnick/advanced-typescript-tagged-types-for-fewer-bugs-and-better-security-24db681d5721) types in this package in order to return more "strict" values. My knowledge of TypeScript at that time was limited to just its title, so I naturally succumbed to that influence and merged whatever changes seemed to be consensual between the participants in the issue discussions. Now though I can see how the concept of "tagged" types is redundant and adds nothing, so I decided to revert any "tagged" types back to simple strings.
108
+
109
+ 1.13.3 / 22.5.2026
110
+ ===================
111
+
112
+ * Updated metadata to version 9.0.31:
113
+ - Updated alternate formatting data for country calling code(s): 84
114
+ - Updated phone metadata for region code(s):
115
+ AI, BO, DZ, ET, GE, GM, IN, TR, UG, VN
116
+ - Updated short number metadata for region code(s): IT
117
+ - Updated geocoding data for country calling code(s): 213 (en)
118
+ - Updated carrier data for country calling code(s):
119
+ 34 (en), 43 (en), 84 (en), 90 (en), 220 (en), 251 (en), 256 (en), 354 (en),
120
+ 591 (en), 1264 (en)
121
+
122
+ 1.13.0 / 08.05.2026
123
+ ===================
124
+
125
+ * Merged a [pull request](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/29) by [Matt d'Entremont](https://gitlab.com/mdentremont) that adds ES6-only versions of `min`/`max`/`mobile`/`core` exports.
126
+
127
+ * The new exports are:
128
+ * `min` — `libphonenumber-js/min/es6`
129
+ * `max` — `libphonenumber-js/max/es6`
130
+ * `mobile` — `libphonenumber-js/mobile/es6`
131
+ * "custom" — `libphonenumber-js/core/es6`
132
+
133
+ * The bundle size reduction is roughly `37 KB` raw and `3.8-4.1 KB` gzipped.
134
+
135
+ ```
136
+ | legacy raw | modern raw | legacy gzip | modern gzip
137
+ min | 177,666 B | 140,563 B | 42,081 B | 38,223 B
138
+ max | 251,327 B | 214,224 B | 62,690 B | 58,750 B
139
+ mobile | 193,117 B | 156,014 B | 46,712 B | 42,682 B
140
+ core | 93,076 B | 56,158 B | 22,308 B | 18,223 B
141
+ ```
142
+
143
+ * Updated `libphonenumber-metadata-generator` package. No functional changes, just cosmetics: renamed some API methods and parameters.
144
+
145
+ * (TypeScript) Added a new exported type `PhoneNumberType`, which is same as the old exported `NumberType` type (which is now considered deprecated) except for `undefined` value.
146
+
147
+ * (TypeScript) Added comments and absent properties in `MetadataJson` interface.
148
+
149
+ 1.12.43 / 07.05.2026
150
+ ===================
151
+
152
+ * Updated metadata to version 9.0.30:
153
+ - Updated alternate formatting data for country calling code(s): 91
154
+ - Updated phone metadata for region code(s): CL, CZ, DE, IN, SG
155
+ - Updated geocoding data for country calling code(s): 91 (en)
156
+ - Updated carrier data for country calling code(s):
157
+ 56 (en), 65 (en), 91 (en), 594 (en), 596 (en), 855 (en)
158
+
159
+ 1.12.42 / 23.4.2026
160
+ ===================
161
+
162
+ * Updated metadata to version 9.0.29:
163
+ - Updated phone metadata for region code(s):
164
+ BI, BL, GP, MF, MY, SK, TH, TR, TW
165
+ - Updated short number metadata for region code(s): CH
166
+ - New geocoding data for country calling code(s): 7 (kk)
167
+ - Updated carrier data for country calling code(s):
168
+ 7 (en, ru), 31 (en), 32 (en), 90 (en), 257 (en), 590 (en), 593 (en)
169
+
170
+ 1.12.42 / 11.4.2026
171
+ ===================
172
+
173
+ * Updated metadata to version 9.0.28:
174
+ - Updated phone metadata for region code(s): BW, IL, MN, RE, SR, YT
175
+ - Updated carrier data for country calling code(s):
176
+ 34 (en), 267 (en), 359 (en), 972 (en), 976 (en)
177
+ - Updated / refreshed time zone meta data.
178
+
179
+ 1.12.41 / 28.3.2026
180
+ ===================
181
+
182
+ * Updated metadata to version 9.0.27:
183
+ - Updated phone metadata for region code(s):
184
+ BF, BL, CM, GF, GH, GP, GU, KE, MF, MQ, MY, SX, TD, TJ, US
185
+ - New geocoding data for country calling code(s): 1738 (en)
186
+ - New carrier data for country calling code(s): 1721 (en)
187
+ - Updated carrier data for country calling code(s):
188
+ 60 (en), 599 (en), 992 (en)
189
+ - Updated / refreshed time zone meta data.
190
+
191
+ 1.12.40 / 13.3.2026
192
+ ===================
193
+
194
+ * Updated metadata to version 9.0.26:
195
+ - Updated phone metadata for region code(s):
196
+ BL, GF, GP, GY, KY, MF, PL, PM, VU
197
+ - Updated short number metadata for region code(s): BL, GF, GP, GY, MF, PM
198
+ - Updated geocoding data for country calling code(s): 48 (en)
199
+ - Updated carrier data for country calling code(s):
200
+ 33 (en), 44 (en), 229 (en), 591 (en), 1345 (en)
201
+
202
+ 1.12.39 / 9.3.2026
203
+ ===================
204
+
205
+ * Updated metadata to version 9.0.25:
206
+ - Updated alternate formatting data for country calling code(s): 90
207
+ - Updated phone metadata for region code(s): 882, HK, MY, PA, SL, TG, TR
208
+ - Updated short number metadata for region code(s): KR
209
+ - New geocoding data for country calling code(s): 1728 (en)
210
+ - Updated carrier data for country calling code(s):
211
+ 33 (en), 44 (en), 55 (en), 60 (en), 81 (en), 90 (en), 228 (en), 232 (en),
212
+ 420 (en), 852 (en, zh)
213
+ - Updated / refreshed time zone meta data.
214
+
215
+ 1.12.38 / 26.2.2026
216
+ ===================
217
+
218
+ * Updated metadata to version 9.0.25:
219
+ - Updated alternate formatting data for country calling code(s): 90
220
+ - Updated phone metadata for region code(s): 882, HK, MY, PA, SL, TG, TR
221
+ - Updated short number metadata for region code(s): KR
222
+ - New geocoding data for country calling code(s): 1728 (en)
223
+ - Updated carrier data for country calling code(s):
224
+ 33 (en), 44 (en), 55 (en), 60 (en), 81 (en), 90 (en), 228 (en), 232 (en),
225
+ 420 (en), 852 (en, zh)
226
+ - Updated / refreshed time zone meta data.
227
+
228
+ 1.12.36 / 30.1.2026
229
+ ===================
230
+
231
+ * Updated metadata to version 9.0.23:
232
+ - Updated alternate formatting data for country calling code(s): 595
233
+ - Updated phone metadata for region code(s):
234
+ AS, BE, CD, EH, GY, IR, JM, MA, MU, PY, SA, US
235
+ - Updated short number metadata for region code(s): PY
236
+ - Updated carrier data for country calling code(s):
237
+ 98 (en, fa), 243 (en), 357 (en), 966 (en), 1658 (en)
238
+
239
+ 1.12.35 / 14.1.2026
240
+ ===================
241
+
242
+ * Updated metadata to version 9.0.22:
243
+ - Updated phone metadata for region code(s):
244
+ AE, AG, AI, AS, BB, BM, BS, CA, DM, DO, GD, GU, HK, JM, KN, KR, KY, LC, MA,
245
+ MP, MS, PR, SG, SX, TC, TT, UG, US, VC, VG, VI
246
+ - Updated geocoding data for country calling code(s): 1305 (en)
247
+ - Updated carrier data for country calling code(s):
248
+ 33 (en), 34 (en), 39 (en), 41 (en), 65 (en), 81 (en), 255 (en), 256 (en),
249
+ 852 (en, zh, zh_Hant), 971 (en)
250
+
251
+ 1.12.33 / 18.12.2025
252
+ ===================
253
+
254
+ * Updated metadata to version 9.0.21:
255
+ - Updated alternate formatting data for country calling code(s): 91
256
+ - Updated phone metadata for region code(s):
257
+ CL, EE, ET, GE, GY, HK, IN, KR, MG, SG, SV, US
258
+ - New geocoding data for country calling code(s): 1353 (en)
259
+ - Updated geocoding data for country calling code(s): 251 (en)
260
+ - Updated carrier data for country calling code(s):
261
+ 34 (en), 36 (en), 43 (en), 48 (en), 56 (en), 65 (en), 261 (en), 501 (en),
262
+ 503 (en), 852 (en, zh)
263
+ - Updated / refreshed time zone meta data.
264
+
265
+ 1.12.32 / 5.12.2025
266
+ ===================
267
+
268
+ * Updated metadata to version 9.0.20:
269
+ - Updated phone metadata for region code(s): GY, IL, MU, TD, TZ, UG, UZ
270
+ - New geocoding data for country calling code(s): 229 (en)
271
+ - Updated carrier data for country calling code(s):
272
+ 34 (en), 230 (en), 255 (en), 256 (en), 998 (en)
273
+
274
+ 1.12.31 / 02.12.2025
275
+ ===================
276
+
277
+ * Merged [Louis Boulagnon](https://gitlab.com/louisboulagnon)'s [fix](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/28): `parse('...') instanceof PhoneNumber` check now works correctly.
278
+
279
+ 1.12.30 / 01.12.2025
280
+ ===================
281
+
282
+ * Merged [Endy Gower](https://gitlab.com/endycb)'s [fix](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/27): `findPhoneNumbersInText()` now correctly finds phone numbers that're separated by a `/` character. Example: `651-234-2345/332-445-1234`.
283
+
284
+ 1.12.29 / 21.11.2025
285
+ ===================
286
+
287
+ * Updated metadata to version 9.0.19:
288
+ - Updated phone metadata for region code(s):
289
+ CF, EE, EH, GE, IN, LB, MA, OM, SG, SN, SV, UG
290
+ - Updated geocoding data for country calling code(s):
291
+ 61 (en), 91 (en), 212 (en)
292
+ - Updated carrier data for country calling code(s):
293
+ 34 (en), 45 (en), 65 (en), 91 (en), 236 (en), 256 (en), 503 (en), 961 (en),
294
+ 995 (en)
295
+
296
+ 1.12.26 / 7.11.2025
297
+ ===================
298
+
299
+ * Updated metadata to version 9.0.18:
300
+ - Updated phone metadata for region code(s):
301
+ AU, BJ, CC, CX, ET, IL, IR, MC, PY, QA, SG, SV, TJ, UG, ZA
302
+ - Updated short number metadata for region code(s): PY
303
+ - Updated geocoding data for country calling code(s): 61 (en)
304
+ - Updated carrier data for country calling code(s):
305
+ 61 (en), 65 (en), 98 (en, fa), 229 (en), 256 (en), 372 (en), 377 (en),
306
+ 503 (en), 972 (en), 992 (en)
307
+ - Updated / refreshed time zone meta data.
308
+
309
+ 1.12.25 / 24.10.2025
310
+ ===================
311
+
312
+ * Updated metadata to version 9.0.17:
313
+ - Updated phone metadata for region code(s): AU, CC, CX, GB, LB, MG, SN
314
+ - Updated short number metadata for region code(s): RO
315
+ - Updated carrier data for country calling code(s):
316
+ 57 (en), 61 (en), 221 (en), 255 (en), 261 (en), 852 (zh), 961 (en)
317
+ - Updated / refreshed time zone meta data.
318
+
319
+ 1.12.24 / 10.10.2025
320
+ ===================
321
+
322
+ * Updated metadata to version 9.0.16:
323
+ - Updated phone metadata for region code(s): CZ, ES, GE, HK, JO, LI, US
324
+ - Updated short number metadata for region code(s): ES
325
+ - New geocoding data for country calling code(s): 1324 (en)
326
+ - Updated geocoding data for country calling code(s): 1437 (en)
327
+ - Updated carrier data for country calling code(s):
328
+ 34 (en), 65 (en), 233 (en), 423 (en), 673 (en), 852 (en, zh), 962 (en),
329
+ 995 (en)
330
+ - Updated / refreshed time zone meta data.
331
+
332
+ 1.12.23 / 26.9.2025
333
+ ===================
334
+
335
+ * Updated metadata to version 9.0.15:
336
+ - Updated phone metadata for region code(s): KE, UG, US
337
+ - Updated short number metadata for region code(s): DE, ES
338
+ - Updated carrier data for country calling code(s): 254 (en), 256 (en)
339
+
340
+ 1.12.22 / 24.9.2025
341
+ ===================
342
+
343
+ * Updated metadata to version 9.0.14:
344
+ - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
345
+ - Updated short number metadata for region code(s): DE
346
+ - New geocoding data for country calling code(s): 1686 (en)
347
+ - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
348
+ - Updated carrier data for country calling code(s):
349
+ 46 (en), 65 (en), 420 (en), 998 (en)
350
+ - Updated / refreshed time zone meta data.
351
+
352
+ 1.12.21 / 23.9.2025
353
+ ===================
354
+
355
+ * Updated metadata to version 9.0.14:
356
+ - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
357
+ - Updated short number metadata for region code(s): DE
358
+ - New geocoding data for country calling code(s): 1686 (en)
359
+ - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
360
+ - Updated carrier data for country calling code(s):
361
+ 46 (en), 65 (en), 420 (en), 998 (en)
362
+ - Updated / refreshed time zone meta data.
363
+
364
+ 1.12.20 / 23.9.2025
365
+ ===================
366
+
367
+ * Updated metadata to version 9.0.14:
368
+ - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
369
+ - Updated short number metadata for region code(s): DE
370
+ - New geocoding data for country calling code(s): 1686 (en)
371
+ - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
372
+ - Updated carrier data for country calling code(s):
373
+ 46 (en), 65 (en), 420 (en), 998 (en)
374
+ - Updated / refreshed time zone meta data.
375
+
376
+ 1.12.19 / 23.9.2025
377
+ ===================
378
+
379
+ * Updated metadata to version 9.0.14:
380
+ - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
381
+ - Updated short number metadata for region code(s): DE
382
+ - New geocoding data for country calling code(s): 1686 (en)
383
+ - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
384
+ - Updated carrier data for country calling code(s):
385
+ 46 (en), 65 (en), 420 (en), 998 (en)
386
+ - Updated / refreshed time zone meta data.
387
+
388
+ 1.12.17 / 12.9.2025
389
+ ===================
390
+
391
+ * (miscellaneous) Updated metadata generator: fixed an error message when a developer attempts to generate custom metadata and the files are not found in Google's github repository.
392
+
393
+ 1.12.16 / 11.9.2025
394
+ ===================
395
+
396
+ * Updated metadata to version 9.0.14:
397
+ - Updated phone metadata for region code(s): CZ, DE, IT, LI, LV, ME, SG, US
398
+ - Updated short number metadata for region code(s): DE
399
+ - New geocoding data for country calling code(s): 1686 (en)
400
+ - Updated geocoding data for country calling code(s): 39 (en, it), 61 (en)
401
+ - Updated carrier data for country calling code(s):
402
+ 46 (en), 65 (en), 420 (en), 998 (en)
403
+ - Updated / refreshed time zone meta data.
404
+
405
+ 1.12.15 / 28.8.2025
406
+ ===================
407
+
408
+ * Updated metadata to version 9.0.13:
409
+ - Updated phone metadata for region code(s):
410
+ BT, DE, GY, IL, OM, PA, SG, SR, UY
411
+ - Updated short number metadata for region code(s): UY
412
+ - Updated geocoding data for country calling code(s): 975 (en)
413
+ - Updated carrier data for country calling code(s):
414
+ 30 (en), 41 (en), 46 (en), 49 (en), 65 (en), 86 (en, zh), 372 (en), 597 (en),
415
+ 968 (en), 975 (en)
416
+
417
+ 1.12.13 / 20.8.2025
418
+ ===================
419
+
420
+ * Updated metadata to version 9.0.12:
421
+ - Updated phone metadata for region code(s): GB, GG, GM, GY, IM, JE
422
+ - Updated geocoding data for country calling code(s): 61 (en), 81 (en, ja)
423
+ - Updated carrier data for country calling code(s):
424
+ 220 (en), 370 (en), 592 (en)
425
+
426
+ 1.12.0 / 24.02.2025
427
+ ===================
428
+
429
+ * Added an export of `PhoneNumber` class, as suggested by [Jan Vincent Liwanag](https://gitlab.com/jvliwanag) in his [pull request](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/26).
430
+
431
+ 1.11.0 / 06.05.2024
432
+ ====================
433
+
434
+ * (TypeScript) Fixed Tagged type to be more strict, as suggested in an [issue](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/144) by Islam Sharabash.
435
+
436
+ 1.10.17 / 08.01.2023
437
+ ==================
438
+
439
+ * [Added](https://github.com/catamphetamine/libphonenumber-js/issues/420) `PhoneNumber.getPossibleCountries()` function. It returns a list of countries this phone number could possibly belong to. Can be used when parsing complete international phone numbers containing a "calling code" that is shared between several countries. If parsing such a phone number returns `country: undefined` then `getPossibleCountries()` function could be used to somehow speculate about what country could this phone number possibly belong to.
440
+
441
+ 1.10.0 / 18.05.2022
442
+ ==================
443
+
444
+ * Migrated the library to use ["ES Modules" export](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/42). This shouldn't break anyone's code and it makes it more modern since people asked about this feature.
445
+
446
+ 1.9.48 / 06.02.2022
447
+ ==================
448
+
449
+ * Merged a [pull request](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/8) that [changed the declaration](https://github.com/catamphetamine/libphonenumber-js/issues/170#issuecomment-1030821520) of basic "string" types like `E164Number`, `NationalNumber`, `Extension`, etc.
450
+
451
+ 1.9.45 / xx.01.2022
452
+ ==================
453
+
454
+ * Added `AsYouType.getNumberValue()` function. The function will be [used](https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/113) in `react-phone-number-input` component. Returns the phone number in [`E.164`](https://en.wikipedia.org/wiki/E.164) format. For example, for country `"US"` and input `"(222) 333-4444"` it will return `"+12223334444"`. Will return `undefined` if no digits have been input, or when inputting a phone number in national format and no default country or default "country calling code" have been set.
455
+
456
+ 1.9.42 / 05.11.2021
457
+ ==================
458
+
459
+ * Added a better called alias for `metadata.full.json` — `metadata.max.json`.
460
+
461
+ 1.9.40 / 02.11.2021
462
+ ==================
463
+
464
+ * Improved [format selection](https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/93) in `AsYouType` formatter: previously it chose the first one before there were at least 3 national (significant) number digits, now it starts filtering out formats right from the start of the national (significant) number.
465
+
466
+ 1.9.36 / 05.10.2021
467
+ ==================
468
+
469
+ * Added a [`setExt(ext: string)`](https://gitlab.com/catamphetamine/libphonenumber-js/#setextext-string) function of a `PhoneNumber` class instance. It could be useful when formatting phone numbers stored as two separate fields: the phone number itself and the extension part.
470
+
471
+ 1.9.27 / 09.09.2021
472
+ ==================
473
+
474
+ * [Added](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/45) TypeScript "typings" on the exported `Metadata` class. Also rewrote `Metadata` class API [docs](https://gitlab.com/catamphetamine/libphonenumber-js#metadata) and the description of [`leading_digits`](https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits) metadata property.
475
+
476
+ * TypeScript `Metadata` exported type was renamed to `MetadataJson` so that the `Metadata` class type could be exported as `Metadata`.
477
+
478
+ 1.9.26 / 05.09.2021
479
+ ==================
480
+
481
+ * [Added](https://github.com/catamphetamine/libphonenumber-js/issues/406) `validatePhoneNumberLength()` function: same as `isPossiblePhoneNumber()` but tells the actual reason why a phone number is not possible: `TOO_SHORT`, `TOO_LONG`, `INVALID_LENGTH`, etc.
482
+
483
+ ```js
484
+ validatePhoneNumberLength('abcde') === 'NOT_A_NUMBER'
485
+ validatePhoneNumberLength('444 1 44') === 'INVALID_COUNTRY'
486
+ validatePhoneNumberLength('444 1 44', 'TR') === 'TOO_SHORT'
487
+ validatePhoneNumberLength('444 1 444', 'TR') === undefined
488
+ validatePhoneNumberLength('444 1 4444', 'TR') === 'INVALID_LENGTH'
489
+ validatePhoneNumberLength('444 1 44444', 'TR') === 'INVALID_LENGTH'
490
+ validatePhoneNumberLength('444 1 444444', 'TR') === undefined
491
+ validatePhoneNumberLength('444 1 4444444444', 'TR') === 'TOO_LONG'
492
+ ```
493
+
494
+ 1.9.20 / 07.06.2021
495
+ ==================
496
+
497
+ * [Changed](https://github.com/google/libphonenumber/commit/c6277266fba8223cfc610cfb1e999deb9f876d65) formatting numbers in `IDD` format to always use the preferred IDD prefix (if defined), not just in cases when a country has multiple IDD prefixes. This means that it will output `8~10` as the prefix instead of `810` for some regions (like Uzbekistan) that have this tilde in their IDD prefix (the tilde designates that the user should wait before continuing to dial).
498
+
499
+ 1.9.11 / 10.02.2021
500
+ ==================
501
+
502
+ * [Added](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/29) `extract: false` option on `parsePhoneNumberFromString()`: it enables a bit "stricter" parsing in a way that it attempts to parse the entire text as a phone number rather than extracting a phone number from text. For example, with `extract: false` option, `"(213) 373-4253"` is parsed as a valid phone number, but `"Call: (213) 373-4253"` is not, because the `"Call: "` part doesn't automatically get trimmed in this case. If there's version `2.x`, I guess `extract: false` will be the default behavior because it looks more appropriate than the default "extract" behavior of Google's `libphonenumber`.
503
+
504
+ * Added `isPossiblePhoneNumber()` and `isValidPhoneNumber()` functions, which are basically shortucts to `parsePhoneNumberFromString(text, { extract: false })` and then `.isValid()`/`.isPossible()`.
505
+
506
+ 1.9.5 / 01.12.2020
507
+ ==================
508
+
509
+ * Fixed the [issue](https://gitlab.com/catamphetamine/libphonenumber-js/-/merge_requests/4) with `findPhoneNumbersInText()` returning incorrect `startAt` and `endsAt` positions in some cases.
510
+
511
+ 1.9.4 / 13.11.2020
512
+ ==================
513
+
514
+ * Refactored the main ES6 export in order to support "tree shaking".
515
+
516
+ 1.9.3 / 11.11.2020
517
+ ==================
518
+
519
+ * Added `AsYouType.getChars()` method.
520
+
521
+ * Added formatting of international phone numbers that have been input without a leading `+`.
522
+
523
+ 1.9.2 / 08.11.2020
524
+ ==================
525
+
526
+ * Metadata `version` is now an integer instead of a semver version. Semver versions of previously generated metadata are automatically converted into an integer version.
527
+
528
+ 1.9.1 / 08.11.2020
529
+ ==================
530
+
531
+ * Merged the latest Google's [patch](https://github.com/google/libphonenumber/commit/55b2646ec9393f4d3d6661b9c82ef9e258e8b829) on parsing phone number extensions.
532
+
533
+ 1.9.0 / 08.11.2020
534
+ ==================
535
+
536
+ * Refactored `AsYouType` formatter.
537
+
538
+ * (could be a breaking change for some) Some people might have used some of the _undocumented_ `AsYouType` instance properties like `.countryCallingCode`, `.nationalNumber`, etc: those have been moved to a new `.state` object. The `.state` object is also not part of the public API, so developers shouldn't use it: use the documented getter methods instead. The `.country` property of `AsYouType` instance still stays: not because it hasn't been moved (it has been and is emulated), but because it has been part of an official (now legacy) API of `AsYouType` formatter.
539
+
540
+ * (misc) Renamed `asYouType` instance method `getCountryCallingCode()` to `getCountryCode()`. The older name still works.
541
+
542
+ * (could be a _build-time_ breaking change for custom metadata) For those who were generating custom metadata, the `libphonenumber-generate-metadata` console command has been moved to a separate package called `libphonenumber-metadata-generator`. The applications that're using it should do `npm install libphonenumber-metadata-generator --save-dev` and then use the new `libphonenumber-metadata-generator` command instead of the old one (only the name changed). [See instructions](https://gitlab.com/catamphetamine/libphonenumber-metadata-generator).
543
+
544
+ 1.8.6 / 05.11.2020
545
+ ==================
546
+
547
+ * Refactored `AsYouType` formatter.
548
+
549
+ * [Fixed](https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/23) `AsYouType` formatter not formatting numbers in some cases like, for example, certain types of Argentinian mobile numbers.
550
+
551
+ <!-- * Found out that all previous `metadata` was missing `domestic_carrier_code_formatting_rule` that is used in a few countries (like Argentina) when formatting phone numbers containing "carrier codes". It has been added now. -->
552
+
553
+ * `humanReadable` option of `"IDD"` formatting has been removed: now it's always `true`. The rationale is that Google's `formatOutOfCountryCallingNumber()` original function always formats in "human readable" format.
554
+
555
+ 1.8.3 / 03.10.2020
556
+ ==================
557
+
558
+ * (advanced) Fixed `metadata.mobile.json` and generating "custom" metadata: now it won't include non-relevant phone number types. Previously, `metadata.mobile.json` (and any other "custom"-generated metadata) included all phone number types for cases when there're several countries corresponding to the same country calling code (for example, `US` and `CA`). So, in case of `metadata.mobile.json`, for `DE` it only contained mobile phone number type, but for `US` and `CA` it contained all phone number types (this has been unnoticed until this release). Now it only contains mobile phone number types for any country, as it's supposed to be. This change didn't result in any significant "mobile" metadata size reduction: just `105 KB` -> `95 KB`.
559
+
560
+ 1.8.1 / 23.09.2020
561
+ ==================
562
+
563
+ * Renamed `parsePhoneNumber()` named export to `parsePhoneNumberWithError()`. The older name still works.
564
+
565
+ 1.8.0 / 22.09.2020
566
+ ==================
567
+
568
+ * Promoted `parsePhoneNumberFromString()` named export to a default export due to the name being too verbose.
569
+
570
+ 1.7.50 / 05.04.2020
571
+ ===================
572
+
573
+ * [Added](https://github.com/catamphetamine/libphonenumber-js/issues/388#issuecomment-609036293) some utility functions to `AsYouType`:
574
+
575
+ ```js
576
+ /**
577
+ * Returns `true` if the phone number is being input in international format.
578
+ * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
579
+ * @return {boolean}
580
+ */
581
+ isInternational()
582
+
583
+ /**
584
+ * Returns the "country calling code" part of the phone number.
585
+ * Returns `undefined` if the number is not being input in international format.
586
+ * Returns "country calling code" for "non-geographic" phone numbering plans too.
587
+ * @return {string} [countryCallingCode]
588
+ */
589
+ getCountryCallingCode()
590
+
591
+ /**
592
+ * Returns a two-letter country code of the phone number.
593
+ * Returns `undefined` for "non-geographic" phone numbering plans.
594
+ * Returns `undefined` if no phone number has been input yet.
595
+ * @return {string} [country]
596
+ */
597
+ getCountry()
598
+
599
+ /**
600
+ * Returns `true` if the phone number is "possible".
601
+ * Is just a shortcut for `PhoneNumber.isPossible()`.
602
+ * @return {boolean}
603
+ */
604
+ isPossible()
605
+
606
+ /**
607
+ * Returns `true` if the phone number is "valid".
608
+ * Is just a shortcut for `PhoneNumber.isValid()`.
609
+ * @return {boolean}
610
+ */
611
+ isValid()
612
+ ```
613
+
614
+ 1.7.38 / 04.02.2020
615
+ ===================
616
+
617
+ * Removed the `"001"` country code ("Non-Geographic Entity"): now in case of "non-geographic" phone numbers their `country` is just `undefined`. Instead, `PhoneNumber` class has an `.isNonGeographic()` method.
618
+
619
+ * Fixed "non-geographic" numbers `.isPossible() === false` bug.
620
+
621
+ 1.7.35 / 03.02.2020
622
+ ===================
623
+
624
+ * Fixed "Non-Geographic Entities" (`001` country code).
625
+
626
+ 1.7.32 / 03.02.2020
627
+ ===================
628
+
629
+ * Refactored the code. Mostly `AsYouType` formatter. `AsYouType.input()` no longer accepts "falsy" values like `null`: instead, it only accepts strings.
630
+
631
+ * Fixed `AsYouType` formatter bugs ([#318](https://github.com/catamphetamine/libphonenumber-js/issues/318)).
632
+
633
+ * Added `nationalPrefix: boolean` option to `PhoneNumber.format()` — Some phone numbers can be formatted both with national prefix and without it. In such cases the library defaults to "with national prefix" (for legacy reasons). Pass `nationalPrefix: false` option to force formatting without national prefix in such cases.
634
+
635
+ * Renamed `findNumbers(text, { v2: true })` to `findPhoneNumbersInText(text)`, and `searchNumbers(text, { v2: true })` to `searchPhoneNumbersInText(text)`.
636
+
637
+ 1.7.27 / 18.11.2019
638
+ ===================
639
+
640
+ * Added `getCountries()` function that returns a list of all available two-letter country codes. This is to prevent some users from having to deal with `Unknown country` error.
641
+
642
+ 1.7.6 / 11.01.2019
643
+ ==================
644
+
645
+ * `findNumbers()`, `searchNumbers()`, `PhoneNumberMatcher` don't throw "Unknown country" error anymore: a non-existent country is simply ignored instead. Same goes for `getExampleNumber()` and `getExtPrefix()`.
646
+
647
+ * `parsePhoneNumberFromString()` doesn't return `undefined` if a non-existent default country is passed: it simply ignores such country instead and still parses international numbers.
648
+
649
+ * Added `isSupportedCountry(country)` function.
650
+
651
+ * Added CDN bundles for `min`/`max`/`mobile` sub-packages.
652
+
653
+ * Moved demo to `max` metadata (was `min` previously).
654
+
655
+ * Added TypeScript definitions for `min`/`max`/`mobile`/`core` sub-packages.
656
+
657
+ 1.7.1 / 01.12.2018
658
+ ==================
659
+
660
+ * Added `/min`, `/max`, `/mobile` and `/custom` subpackages pre-wired with different flavors of metadata. See the relevant readme section for more info.
661
+
662
+ * Added `parsePhoneNumberFromString()` function (which doesn't throw but instead returns `undefined`).
663
+
664
+ 1.7.0 / 31.12.2018
665
+ ==================
666
+
667
+ * Refactored the code to remove cyclic dependencies which caused warnings on React Native. It's not a breaking change but it's still a big code diff overall so incremented the "minor" version number.
668
+
669
+ 1.6.2 / 18.10.2018
670
+ ==================
671
+
672
+ * Support Russian extension character "доб" as a valid one while parsing the numbers.
673
+
674
+ 1.6.1 / 18.10.2018
675
+ ==================
676
+
677
+ * Added `.getNumber()` method to `AsYouType` formatter instance. Returns a `PhoneNumber`.
678
+
679
+ 1.6.0 / 17.10.2018
680
+ ==================
681
+
682
+ * Added `parsePhoneNumber()` function and `PhoneNumber` class.
683
+
684
+ * Added `v2: true` option to `findNumbers()` function.
685
+
686
+ * Added `getExampleNumber()` function.
687
+
688
+ * Added `isPossibleNumber()` function.
689
+
690
+ * In `formatNumber()` renamed `National` to `NATIONAL` and `International` to `INTERNATIONAL`. The older variants still work but are considered deprecated.
691
+
692
+ * (metadata file internal format breaking change) (doesn't affect users of this library) If anyone was using metadata files from this library bypassing the library functions (i.e. those who parsed `metadata.min.json` file manually) then there's a new internal optimization introduced in this version: previously `formats` were copy-pasted for each country of the same region (e.g. `NANPA`) while now the `formats` are only defined on the "main" country for region and other countries simply read the `formats` from it at runtime. This reduced the default metadata file size by 5 kilobytes.
693
+
694
+ 1.5.0 / 26.09.2018
695
+ ==================
696
+
697
+ * Deprecated `findPhoneNumbers()`, `searchPhoneNumbers()` and `PhoneNumberSearch`. Use `findNumbers()`, `searchNumbers()` and `PhoneNumberMatcher` instead. The now-deprecated functions were a half-self-made implementation of Google's Java `findNumbers()` until the Java code was ported into javascript and passed tests. The port of Google's Java implementation is supposed to find numbers more correctly. It hasn't been tested by users in production yet, but the same tests as for the previous implementation of `findPhoneNumbers()` pass, so seems that it can be used in production.
698
+
699
+ 1.4.6 / 12.09.2018
700
+ ==================
701
+
702
+ * Fixed `formatNumber('NATIONAL')` not formatting national phone numbers with a national prefix when it's marked as optional (e.g. Russia). Before it didn't add national prefix when formatting national numbers if national prefix was marked as optional. Now it always adds national prefix when formatting national numbers even when national prefix is marked as optional.
703
+
704
+ 1.4.5 / 07.09.2018
705
+ ==================
706
+
707
+ * A bug in `matches_entirely` was found by a user which resulted in incorrect regexp matching in some cases, e.g. when there was a `|` in a regexp. This could cause incorrect `parseNumber()` results, or any other weird behaviour.
708
+
709
+ 1.4.0 / 03.08.2018
710
+ ==================
711
+
712
+ * Changed the output of `AsYouType` formatter. E.g. before for `US` and input `21` it was outputting `(21 )` which is not good for phone number input (not intuitive and is confusing). Now it will not add closing braces which haven't been reached yet by the input cursor and it will also strip the corresponding opening braces, so for `US` and input `21` it now is just `21`, and for `213` it is `(213)`.
713
+
714
+ * (could be a breaking change for those who somehow used `.template` property of an `AsYouType` instance) Due to the change in `AsYouType` formatting the `.template` property no longer strictly corresponds to the output, e.g. for `US` and input `21` the output is now `21` but the `.template` is still `(xxx) xxx-xxxx` like it used to be in the older versions when the output was `(21 )`. Therefore, a new function has been added to `AsYouType` instance called `.getTemplate()` which will return the _partial_ template for the currently input value, so for input `21` the output will be `21` and `.getTemplate()` will return `xx`, and for input `213` the output will be `(213)` and `.getTemplate()` will return `(xxx)`. So there is this difference between the new `.getTemplate()` function and the old `.template` property: the old `.template` property always returns the template for a fully entered phone number and the new `.getTemplate()` function always returns the template for the _partially_ entered phone number, i.e. for the partially entered number `(213) 45` it will return template `(xxx) xx` so it's a one-to-one correspondence now.
715
+
716
+ 1.3.0 / 25.07.2018
717
+ ==================
718
+
719
+ * Fixed `parseNumber()`, `isValidNumber()` and `getNumberType()` in some rare cases (made them a bit less strict where it fits): previously they were treating `defaultCountry` argument as "the country" in case of local numbers, e.g. `isValidNumber('07624 369230', 'GB')` would be `false` because `07624 369230` number belongs to `IM` (the Isle of Man). While `IM` is not `GB` it should still be `true` because `GB` is the _default_ country, without it necessarily being _the_ country.
720
+
721
+ * Added a new function `isValidNumberForRegion(number, country)` which mimics [Google's `libphonenumber`'s one](https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion).
722
+
723
+ 1.2.13 / 30.05.2018
724
+ ===================
725
+
726
+ * Fixed a previously unnoticed [bug](https://github.com/catamphetamine/libphonenumber-js/issues/217) regarding parsing RFC3966 phone URIs: previously `:` was mistakenly being considered a key-value separator instead of `=`. E.g. it was parsing RFC3966 phone numbers as `tel:+78005553535;ext:123` instead of `tel:+78005553535;ext=123`. The bug was found and reported by @cdunn.
727
+
728
+ 1.2.6 / 12.05.2018
729
+ ===================
730
+
731
+ * Removed `parseNumber()`'s `fromCountry` parameter used for parsing IDD prefixes: now it uses `defaultCountry` instead. `formatNumber()`'s `fromCountry` parameter stays and is not removed.
732
+
733
+ 1.2.5 / 11.05.2018
734
+ ===================
735
+
736
+ * Optimized metadata a bit: using `0` instead of `null`/`false` and `1` instead of `true`.
737
+
738
+ 1.2.0 / 08.05.2018
739
+ ===================
740
+
741
+ * Added support for [IDD prefixes](https://en.wikipedia.org/wiki/International_direct_dialing) — `parse()` now parses IDD-prefixed phones if `fromCountry` option is passed, `format()` now has an `IDD` format.
742
+
743
+ 1.1.7 / 01.04.2018
744
+ ===================
745
+
746
+ * Added `parseNumber()` and `formatNumber()` aliases for `parse()` and `format()`. Now these are the default ones, and `parse()` and `format()` names are considered deprecated. The rationale is that `parse()` and `format()` function names are too unspecific and can clash with other functions declared in a javascript file. And also searching in a project for `parseNumber` and `formatNumber` is easier than searching in a project for `parse` and `format`.
747
+
748
+ * Fixed `parseRFC3966()` and `formatRFC3966()` non-custom exports.
749
+
750
+ 1.1.4 / 15.03.2018
751
+ ===================
752
+
753
+ * `parse()` is now more forgiving when parsing invalid international numbers. E.g. `parse('+49(0)15123020522', 'DE')` doesn't return `{}` and instead removes the invalid `(0)` national prefix from the number.
754
+
755
+ 1.1.1 / 10.03.2018
756
+ ===================
757
+
758
+ * Added `PhoneNumberSearch` class for asynchronous phone number search.
759
+
760
+ 1.1.0 / 09.03.2018
761
+ ===================
762
+
763
+ * Added `findPhoneNumbers` function.
764
+
765
+ 1.0.22 / 13.02.2018
766
+ ===================
767
+
768
+ * Added `parseRFC3966` and `formatRFC3966` functions which are exported.
769
+
770
+ 1.0.18 / 12.02.2018
771
+ ===================
772
+
773
+ * Fixed custom metadata backwards compatibility [bug](https://github.com/catamphetamine/libphonenumber-js/issues/180) introduced in `1.0.16`. All people who previously installed `1.0.16` or `1.0.17` should update.
774
+ * Refactored metadata module which now supports versioning by adding the `version` property to metadata JSON.
775
+
776
+ 1.0.17 / 07.02.2018
777
+ ===================
778
+
779
+ * Fixed `RFC3966` format not prepending `tel:` to the output.
780
+ * Renamed `{ possible: true }` option to `{ extended: true }` and the result is now more verbose (see the README).
781
+ * Added `possible_lengths` property in metadata: metadata generated using previous versions of the library should be re-generated with then new version.
782
+
783
+ 1.0.16 / 07.02.2018
784
+ ===================
785
+
786
+ * (experimental) Added `{ possible: true }` option for `parse()` for parsing "possible numbers" which are not considered valid (like Google's demo does). E.g. `parse('+71111111111', { possible: true }) === { countryCallingCode: '7', phone: '1111111111', possible: true }` and `format({ countryCallingCode: '7', phone: '1111111111' }, 'E.164') === '+71111111111'`.
787
+ * `getPhoneCode` name is deprecated, use `getCountryCallingCode` instead.
788
+ * `getPhoneCodeCustom` name is deprecated, use `getCountryCallingCodeCustom` instead.
789
+ * `AsYouType.country_phone_code` renamed to `AsYouType.countryCallingCode` (but no one should have used that property).
790
+
791
+ 1.0.0 / 21.01.2018
792
+ ==================
793
+
794
+ * If `country: string` argument is passed to `parse()` now it becomes "the default country" rather than "restrict to country" ("restrict to country" option is gone).
795
+ * `parse()` `options` argument changed: it's now an undocumented feature and can have only a single option inside — `defaultCountry: string` — which should be passed as a string argument instead.
796
+ * Removed all previously deprecated stuff: all underscored exports (`is_valid_number`, `get_number_type` and `as_you_type`), lowercase exports for `asYouType` and `asYouTypeCustom` (use `AsYouType` and `AsYouTypeCustom` instead), `"International_plaintext"` format (use `"E.164"` instead).
797
+ * Integer phone numbers no longer [get automatically converted to strings](https://github.com/googlei18n/libphonenumber/blob/master/FALSEHOODS.md).
798
+ * `parse()`, `isValidNumber()`, `getNumberType()` and `format()` no longer accept `undefined` phone number argument: it must be either a string or a parsed number object having a string `phone` property.
799
+
800
+ 0.4.52 / 21.01.2018
801
+ ===================
802
+
803
+ * Added `formatExtension(number, extension)` option to `format()`
804
+
805
+ 0.4.50 / 20.01.2018
806
+ ===================
807
+
808
+ * Added support for phone number extensions.
809
+ * `asYouType` name is deprecated, use `AsYouType` instead (same goes for `asYouTypeCustom`).
810
+ * `is_valid_number`, `get_number_type` and `as_you_type` names are deprecated, use camelCased names instead.
811
+ * `International_plaintext` format is deprecated, use `E.164` instead.
812
+ * Added `RFC3966` format for phone number URIs (`tel:+1213334455;ext=123`).
813
+
814
+ 0.4.2 / 30.03.2017
815
+ ===================
816
+
817
+ * Added missing `getNumberTypeCustom` es6 export
818
+
819
+ 0.4.0 / 29.03.2017
820
+ ===================
821
+
822
+ * Removed `.valid` from "as you type" formatter because it wasn't reliable (gave false negatives). Use `isValidNumber(value)` for phone number validation instead.
823
+
824
+ 0.3.11 / 07.03.2017
825
+ ===================
826
+
827
+ * Fixed a bug when "as you type" formatter incorrectly formatted the input using non-matching phone number formats
828
+
829
+ 0.3.8 / 25.02.2017
830
+ ===================
831
+
832
+ * Loosened national prefix requirement when parsing (fixed certain Brazilian phone numbers parsing)
833
+
834
+ 0.3.6 / 16.02.2017
835
+ ===================
836
+
837
+ * Added more strict validation to `isValidNumber`
838
+ * Fixed CommonJS export for `getNumberType`
839
+
840
+ 0.3.5 / 15.02.2017
841
+ ===================
842
+
843
+ * Now exporting `getNumberType` function
844
+
845
+ 0.3.0 / 29.01.2017
846
+ ===================
847
+
848
+ * Removed `libphonenumber-js/custom.es6` exported file: now everything should be imported from the root package in ES6-capable bundlers (because tree-shaking actually works that way)
849
+ * Now custom functions like `parse`, `format` and `isValidNumber` are not bound to custom metadata: it's passed as the last argument instead. And custom `asYouType` is now not a function — instead, `asYouType` constructor takes an additional `metadata` argument
850
+
851
+ 0.2.29 / 12.01.2017
852
+ ===================
853
+
854
+ * Fixed `update-metadata` utility
855
+
856
+ 0.2.26 / 02.01.2017
857
+ ===================
858
+
859
+ * Added national prefix check for `parse` and `isPhoneValid`
860
+
861
+ 0.2.25 / 30.12.2016
862
+ ===================
863
+
864
+ * A bit more precise `valid` flag for "as you type" formatter
865
+
866
+ 0.2.22 / 28.12.2016
867
+ ===================
868
+
869
+ * Added metadata update `bin` command for end users (see README)
870
+ * Added the ability to include extra regular expressions for finer-grained phone number validation
871
+
872
+ 0.2.20 / 28.12.2016
873
+ ===================
874
+
875
+ * Added the ability to use custom-countries generated metadata as a parameter for the functions exported from this library
876
+
877
+ 0.2.19 / 25.12.2016
878
+ ===================
879
+
880
+ * Small fix for "as you type" to not prepend national prefix to the number being typed
881
+
882
+ 0.2.13 / 23.12.2016
883
+ ===================
884
+
885
+ * Reset `default_country` for "as you type" if the input is an international phone number
886
+
887
+ 0.2.12 / 23.12.2016
888
+ ===================
889
+
890
+ * (misc) Small fix for `format()` when the national number is `undefined`
891
+
892
+ 0.2.10 / 23.12.2016
893
+ ===================
894
+
895
+ * Better "as you type" matching: when the national prefix is optional it now tries both variants — with the national prefix extracted and without
896
+
897
+ 0.2.9 / 22.12.2016
898
+ ===================
899
+
900
+ * Exporting `metadata` and `getPhoneCode()`
901
+
902
+ 0.2.6 / 22.12.2016
903
+ ===================
904
+
905
+ * Fixed a minor bug in "as you type" when a local phone number without national prefix got formatted with the national prefix
906
+
907
+ 0.2.2 / 14.12.2016
908
+ ===================
909
+
910
+ * Fixed a bug when country couldn't be parsed from a phone number in most cases
911
+
912
+ 0.2.1 / 10.12.2016
913
+ ===================
914
+
915
+ * Added `.country_phone_code` readable property to "as you type" formatter
916
+
917
+ 0.2.0 / 02.12.2016
918
+ ===================
919
+
920
+ * "As you type" formatter's `country_code` argument is now `default_country_code`, and it doesn't restrict to the specified country anymore.
921
+
922
+ 0.1.17 / 01.12.2016
923
+ ===================
924
+
925
+ * "As you type" formatter `template` fix for national prefixes (which weren't replaced with `x`-es)
926
+
927
+ 0.1.16 / 01.12.2016
928
+ ===================
929
+
930
+ * "As you type" formatter now formats the whole input passed to the `.input()` function one at a time without splitting it into individual characters (which yields better performance)
931
+
932
+ 0.1.14 / 01.12.2016
933
+ ===================
934
+
935
+ * Added `valid`, `country` and `template` fields to "as you type" instance
936
+
937
+ 0.1.12 / 30.11.2016
938
+ ===================
939
+
940
+ * Managed to reduce metadata size by another 5 KiloBytes removing redundant (duplicate) phone number type regular expressions (because there's no "get phone type" API in this library).
941
+
942
+ 0.1.11 / 30.11.2016
943
+ ===================
944
+
945
+ * Managed to reduce metadata size by 10 KiloBytes removing phone number type regular expressions when `leading_digits` are present.
946
+
947
+ 0.1.10 / 30.11.2016
948
+ ===================
949
+
950
+ * Turned out those numerous bulky regular expressions (`<fixedLine/>`, `<mobile/>`, etc) are actually required to reliably infer country from country calling code and national phone number in cases where there are multiple countries assigned to the same country phone code (e.g. NANPA), so I've included those big regular expressions for those ambiguous cases which increased metadata size by 20 KiloBytes resulting in a total of 90 KiloBytes for the metadata.
951
+
952
+ 0.1.9 / 30.11.2016
953
+ ===================
954
+
955
+ * Small fix for "as you type" formatter: replacing digit placeholders (punctuation spaces) with regular spaces in the output
956
+
957
+ 0.1.8 / 29.11.2016
958
+ ===================
959
+
960
+ * Fixed a bug when national prefix `1` was present in "as you type" formatter for NANPA countries (while it shouldn't have been present)
961
+
962
+ 0.1.7 / 29.11.2016
963
+ ===================
964
+
965
+ * (may be a breaking change) renamed `.clear()` to `.reset()` for "as you type" formatter
966
+
967
+ 0.1.5 / 29.11.2016
968
+ ===================
969
+
970
+ * Better `asYouType` (better than Google's original "as you type" formatter)
971
+
972
+ 0.1.0 / 28.11.2016
973
+ ===================
974
+
975
+ * Added `asYouType` and `isValidNumber`.
976
+
977
+ 0.0.3 / 24.11.2016
978
+ ===================
979
+
980
+ * Added `format` function.
981
+
982
+ 0.0.1 / 24.11.2016
983
+ ===================
984
+
972
985
  * Initial release. `parse` function is working.