GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Extract the MIME type from a data: URL.

      Parameters

      • url: string

        A full data: URL, e.g. data:image/png;base64,iVBOR….

      Returns string | null

      The MIME type (image/png), or null when the URL is malformed.

      Stops at the first ; or ,, so encoding parameters stay out of the result. Exported as the single parser for this format: a hand-rolled variant in utils/validators/general-validators.ts used to return image/png;base64 — harmless against a startsWith("image/") test, but wrong against an exact whitelist. Sharing the parser is what makes sharing the whitelist safe.