From a0c6f80f76d60bc2bb36942d4162b90e6b5aa2a2 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 11 Aug 2024 14:05:15 +0200 Subject: dom: remove generic JS bindings Dispatch manually with fromJS instead. --- src/config/mimetypes.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/config/mimetypes.nim') 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) -- cgit 1.4.1-2-gfad0