localHostOrDomainIs.d.ts 894 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Is true if the hostname matches exactly the specified hostname, or if there is
  3. * no domain name part in the hostname, but the unqualified hostname matches.
  4. *
  5. * Examples:
  6. *
  7. * ``` js
  8. * localHostOrDomainIs("www.netscape.com", "www.netscape.com")
  9. * // is true (exact match).
  10. *
  11. * localHostOrDomainIs("www", "www.netscape.com")
  12. * // is true (hostname match, domain not specified).
  13. *
  14. * localHostOrDomainIs("www.mcom.com", "www.netscape.com")
  15. * // is false (domain name mismatch).
  16. *
  17. * localHostOrDomainIs("home.netscape.com", "www.netscape.com")
  18. * // is false (hostname mismatch).
  19. * ```
  20. *
  21. * @param {String} host the hostname from the URL.
  22. * @param {String} hostdom fully qualified hostname to match against.
  23. * @return {Boolean}
  24. */
  25. export default function localHostOrDomainIs(host: string, hostdom: string): boolean;
  26. //# sourceMappingURL=localHostOrDomainIs.d.ts.map