dravenk / mime

zig package for mapping extensions to mime types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zig Module for MIME Types

Synopsis

const std = @import("std");
const mime = @import("mime");

test "html smoke test" {
    const mime_type = mime.extension_map.get(".html").?;
    try std.testing.expectEqualStrings("text/html", @tagName(mime_type));
}

test "bogus extension" {
    try std.testing.expect(mime.extension_map.get(".sillybogo") == null);
}

About

zig package for mapping extensions to mime types

License:MIT License


Languages

Language:Zig 100.0%