custom.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // The `/custom` export has been long deprecated: use `/core` export instead.
  2. 'use strict'
  3. var parsePhoneNumberFromString = require('./build/parsePhoneNumber.js').default
  4. // ES5 `require()` "default" "interoperability" hack.
  5. // https://github.com/babel/babel/issues/2212#issuecomment-131827986
  6. // An alternative approach:
  7. // https://www.npmjs.com/package/babel-plugin-add-module-exports
  8. exports = module.exports = parsePhoneNumberFromString
  9. exports['default'] = parsePhoneNumberFromString
  10. exports.ParseError = require('./build/ParseError.js').default
  11. var parsePhoneNumberWithError = require('./build/parsePhoneNumberWithError.js').default
  12. // `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.
  13. exports.parsePhoneNumber = parsePhoneNumberWithError
  14. exports.parsePhoneNumberWithError = parsePhoneNumberWithError
  15. // `parsePhoneNumberFromString()` named export is now considered legacy:
  16. // it has been promoted to a default export due to being too verbose.
  17. exports.parsePhoneNumberFromString = parsePhoneNumberFromString
  18. // Deprecated: remove `parse()` export in 2.0.0.
  19. // (renamed to `parseNumber()`)
  20. exports.parse = require('./build/legacy/parse.js').default
  21. exports.parseNumber = require('./build/legacy/parse.js').default
  22. // Deprecated: remove `format()` export in 2.0.0.
  23. // (renamed to `formatNumber()`)
  24. exports.format = require('./build/legacy/format.js').default
  25. exports.formatNumber = require('./build/legacy/format.js').default
  26. exports.getNumberType = require('./build/legacy/getNumberType.js').default
  27. exports.isValidNumber = require('./build/legacy/isValidNumber.js').default
  28. exports.isValidNumberForRegion = require('./build/legacy/isValidNumberForRegion.js').default
  29. // Deprecated.
  30. exports.isPossibleNumber = require('./build/legacy/isPossibleNumber.js').default
  31. exports.findNumbers = require('./build/legacy/findNumbers.js').default
  32. exports.searchNumbers = require('./build/legacy/searchNumbers.js').default
  33. exports.findPhoneNumbers = require('./build/legacy/findPhoneNumbers.js').default
  34. exports.searchPhoneNumbers = require('./build/legacy/findPhoneNumbers.js').searchPhoneNumbers
  35. exports.PhoneNumberSearch = require('./build/legacy/findPhoneNumbersInitialImplementation.js').PhoneNumberSearch
  36. exports.getExampleNumber = require('./build/getExampleNumber.js').default
  37. exports.findPhoneNumbersInText = require('./build/findPhoneNumbersInText.js').default
  38. exports.searchPhoneNumbersInText = require('./build/searchPhoneNumbersInText.js').default
  39. exports.PhoneNumberMatcher = require('./build/PhoneNumberMatcher.js').default
  40. exports.AsYouType = require('./build/AsYouType.js').default
  41. exports.formatIncompletePhoneNumber = require('./build/formatIncompletePhoneNumber.js').default
  42. exports.parseIncompletePhoneNumber = require('./build/parseIncompletePhoneNumber.js').default
  43. exports.parsePhoneNumberCharacter = require('./build/parseIncompletePhoneNumber.js').parsePhoneNumberCharacter
  44. exports.parseDigits = require('./build/helpers/parseDigits.js').default
  45. // Deprecated: `DIGITS` were used by `react-phone-number-input`.
  46. // Replaced by `parseDigits()`.
  47. //
  48. // Deprecated: `DIGIT_PLACEHOLDER` was used by `react-phone-number-input`.
  49. // Not used anymore.
  50. //
  51. exports.DIGITS = require('./build/helpers/parseDigits.js').DIGITS
  52. exports.DIGIT_PLACEHOLDER = require('./build/AsYouTypeFormatter.js').DIGIT_PLACEHOLDER
  53. exports.getCountries = require('./build/getCountries.js').default
  54. exports.getCountryCallingCode = require('./build/getCountryCallingCode.js').default
  55. // `getPhoneCode` name is deprecated, use `getCountryCallingCode` instead.
  56. exports.getPhoneCode = exports.getCountryCallingCode
  57. exports.Metadata = require('./build/metadata.js').default
  58. exports.isSupportedCountry = require('./build/metadata.js').isSupportedCountry
  59. exports.getExtPrefix = require('./build/metadata.js').getExtPrefix
  60. exports.parseRFC3966 = require('./build/helpers/RFC3966.js').parseRFC3966
  61. exports.formatRFC3966 = require('./build/helpers/RFC3966.js').formatRFC3966
  62. // exports['default'] = ...