SimpleShortenerCheck

SimpleShortenerCheck

SimpleShortenerCheck allows you to check single URLs at once using the checkSingle method, while handling iteration over each URL for you.

Constructor

new SimpleShortenerCheck()

Source:
Example
const list = new Set();

blacklist.add('bit.ly');

class SomeShorteners extends SimpleSafetyCheck {
    checkSingle(url) {
        return blacklist.has(url.toString());
    }
}

Methods

checkSingle(url) → {Promise.<(Boolean|String)>|Boolean|String}

Source:

Check to see if the provided URL should be considered shortened or not. Returns a truthy value if the URL is flagged as shortened.

If this returns a Promise, the Promise will be awaited.

Parameters:
Name Type Description
url URL

The URL to be tested.

Returns:

The result of the safety check.

Type
Promise.<(Boolean|String)> | Boolean | String