diff options
Diffstat (limited to 'src/config/mimetypes.nim')
-rw-r--r-- | src/config/mimetypes.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/config/mimetypes.nim b/src/config/mimetypes.nim index 9beb42c7..d9e21aaf 100644 --- a/src/config/mimetypes.nim +++ b/src/config/mimetypes.nim @@ -6,8 +6,8 @@ import utils/twtstr # extension -> type type MimeTypes* = distinct Table[string, string] -template `[]`*(mimeTypes: MimeTypes; k: string): string = - Table[string, string](mimeTypes)[k] +template getOrDefault*(mimeTypes: MimeTypes; k, fallback: string): string = + Table[string, string](mimeTypes).getOrDefault(k, fallback) template contains*(mimeTypes: MimeTypes; k: string): bool = k in Table[string, string](mimeTypes) |