isValidNumber.js 881 B

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports["default"] = isValidNumber;
  6. var _isValid = _interopRequireDefault(require("../isValid.js"));
  7. var _getNumberType = require("./getNumberType.js");
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  9. // Finds out national phone number type (fixed line, mobile, etc)
  10. function isValidNumber() {
  11. var _normalizeArguments = (0, _getNumberType.normalizeArguments)(arguments),
  12. input = _normalizeArguments.input,
  13. options = _normalizeArguments.options,
  14. metadata = _normalizeArguments.metadata; // `parseNumber()` would return `{}` when no phone number could be parsed from the input.
  15. if (!input.phone) {
  16. return false;
  17. }
  18. return (0, _isValid["default"])(input, options, metadata);
  19. }
  20. //# sourceMappingURL=isValidNumber.js.map