You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

isPlainHostName.js 439B

123456789101112131415161718192021222324252627
  1. /**
  2. * Module exports.
  3. */
  4. module.exports = isPlainHostName;
  5. /**
  6. * True iff there is no domain name in the hostname (no dots).
  7. *
  8. * Examples:
  9. *
  10. * ``` js
  11. * isPlainHostName("www")
  12. * // is true.
  13. *
  14. * isPlainHostName("www.netscape.com")
  15. * // is false.
  16. * ```
  17. *
  18. * @param {String} host The hostname from the URL (excluding port number).
  19. * @return {Boolean}
  20. */
  21. function isPlainHostName (host) {
  22. return !(/\./.test(host));
  23. }