host.js 366 B

1234567891011121314151617181920212223242526
  1. "use strict";
  2. function parseHost(urlObj, options)
  3. {
  4. // TWEAK :: condition only for speed optimization
  5. if (options.ignore_www)
  6. {
  7. var host = urlObj.host.full;
  8. if (host)
  9. {
  10. var stripped = host;
  11. if (host.indexOf("www.") === 0)
  12. {
  13. stripped = host.substr(4);
  14. }
  15. urlObj.host.stripped = stripped;
  16. }
  17. }
  18. }
  19. module.exports = parseHost;