Hierarchy

  • default

Constructors

Properties

options: Required<SafelinkOptions> = ...
parseQuery: ((query, url) => Nullable<parseQueryResult>) = _parseQuery

Type declaration

    • (query, url): Nullable<parseQueryResult>
    • Parse Query URL and Hash

      Parameters

      • query: string

        query key, null = return all objects

      • url: string

        target query, ex: location.href or location.search

      Returns Nullable<parseQueryResult>

Methods

  • anonymize url directly

    Parameters

    • href: string

    Returns string

  • is url excluded

    Parameters

    • url: string | URL

    Returns boolean

  • parse html string or element to anonymize urls

    Parameters

    • target: string | Buffer | ReadStream | HTMLElement

    Returns Promise<string>

  • parse single url

    Parameters

    • url: string

    Returns string

    return redirect url or original url

    • when redirect not set, will return encoded URL only