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.
A parsed locator.
The label.
formatLocator(parseLocator('https://example.com/a/b')); // 'example.com'formatLocator(parseLocator('mailto:ada@example.com')); // 'ada@example.com' Copy
formatLocator(parseLocator('https://example.com/a/b')); // 'example.com'formatLocator(parseLocator('mailto:ada@example.com')); // 'ada@example.com'
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.