Home Identifier Source Test Repository
public class | source

LinkAnalyzer

Hold logic about recursive links processing

Constructor Summary

Public Constructor
public

constructor(initial: String, options: Object)

Initialize predefined skip rules for prevent deeper crawling for given url

Member Summary

Private Members
private
private

_url(initial: Object): Object: *

Parsed url object from Url.parse

Method Summary

Public Methods
public

Checks if given url is external

public

Returns true if anyone of skip conditions returns true

Private Methods
private

Checks if given url has host different then host of initial url

private

Checks if given url has the different hostname then initial

private

Check if protocol of given url satisfies acceptedSchemes criteria

private

_skipOnMode(url: *, baseUrl: *): boolean: boolean

Checks if given url is need to be check depending on mode configuration option

Public Constructors

public constructor(initial: String, options: Object) source

Initialize predefined skip rules for prevent deeper crawling for given url

Params:

NameTypeAttributeDescription
initial String

url

options Object

object

Private Members

private _options: * source

private _url(initial: Object): Object: * source

Parsed url object from Url.parse

Return:

Object

options object

Public Methods

public isExternal(url: String): boolean source

Checks if given url is external

Params:

NameTypeAttributeDescription
url String

request url

Return:

boolean

true if url is external. false otherwise

public isNeedToSkipUrl(url: String, baseUrl: String): boolean source

Returns true if anyone of skip conditions returns true

Params:

NameTypeAttributeDescription
url String

url of link

baseUrl String

url of page where link is

Return:

boolean

result flag

Private Methods

private _skipExcludedUrls(url: String): boolean source

Checks if given url has host different then host of initial url

Params:

NameTypeAttributeDescription
url String

request

Return:

boolean

result flag

private _skipExternalUrls(url: String): boolean source

Checks if given url has the different hostname then initial (If 'checkExternalUrls'rule is set to true)

Params:

NameTypeAttributeDescription
url String

request url

Return:

boolean

result flag

private _skipNonAcceptableProtocols(url: String): boolean source

Check if protocol of given url satisfies acceptedSchemes criteria

Params:

NameTypeAttributeDescription
url String

request url

Return:

boolean

result flag

private _skipOnMode(url: *, baseUrl: *): boolean: boolean source

Checks if given url is need to be check depending on mode configuration option

Params:

NameTypeAttributeDescription
url *
baseUrl *

Return:

boolean