Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    • Compute the "base URL" the browser should start at, given a current dataset URL (which may itself end in .zarr or .zarr.zip and therefore live one directory below the listing target).

      Logic:

      • empty / falsy URL: return ${origin}/ (top of the configured server).
      • URL ending in .zarr, .zarr/, or .zarr.zip: strip the trailing dataset segment so we list the directory containing the dataset.
      • otherwise: return origin + pathname unchanged.
      • on parse failure: return the input verbatim (defensive — the caller does not need to handle the throw).

      Parameters

      • url: string

        The current ?src=... URL, possibly empty.

      • origin: string

        Fallback origin when url is empty.

      Returns string