isPlainHostName.js 528 B

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