Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Function normalizeDataSourceUrl

    • Validate and normalize a data-source URL from user-controlled input.

      Accepted forms:

      • Absolute HTTP(S) URLs: https://example.com/data.zarr
      • Root-relative paths: /datasets/data.zarr
      • Relative paths: datasets/data.zarr

      Rejected forms include unsupported schemes (file:, javascript:, data:, vbscript:, blob:, etc.), protocol-relative URLs (//host/path), control characters, obvious HTML delimiters, empty strings, and excessively long values.

      Trailing slashes are stripped: the zarr loader appends path components (metadata, chunks) to this string, and stripping here is what lets the viewer accept both spellings while storing the canonical no-trailing-slash form (see CLAUDE.md "Data Source URLs Normalize Trailing Slashes").

      Parameters

      • rawSrc: string | null

      Returns string | null