host.js 366 B

123456789101112131415161718192021222324252627
  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;