kernl API
    Preparing search index...

    Function formatLocator

    • Produces a short user-facing label for a locator: a name where one is known, otherwise the host or peer. The label never includes the scheme.

      Parameters

      • locator: Locator

        A parsed locator.

      Returns string

      The label.

      formatLocator(parseLocator('https://example.com/a/b')); // 'example.com'
      formatLocator(parseLocator('mailto:ada@example.com')); // 'ada@example.com'