main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
366 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | function parseHost(urlObj, options)
|
---|
| 4 | {
|
---|
| 5 | // TWEAK :: condition only for speed optimization
|
---|
| 6 | if (options.ignore_www)
|
---|
| 7 | {
|
---|
| 8 | var host = urlObj.host.full;
|
---|
| 9 |
|
---|
| 10 | if (host)
|
---|
| 11 | {
|
---|
| 12 | var stripped = host;
|
---|
| 13 |
|
---|
| 14 | if (host.indexOf("www.") === 0)
|
---|
| 15 | {
|
---|
| 16 | stripped = host.substr(4);
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | urlObj.host.stripped = stripped;
|
---|
| 20 | }
|
---|
| 21 | }
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 |
|
---|
| 25 |
|
---|
| 26 | module.exports = parseHost;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.