diff options
author | bptato <nincsnevem662@gmail.com> | 2024-08-11 14:05:15 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-08-11 14:05:15 +0200 |
commit | a0c6f80f76d60bc2bb36942d4162b90e6b5aa2a2 (patch) | |
tree | dbf93dc3b168c4a9e135f0fa4e1300892645ba68 /src/config/mimetypes.nim | |
parent | d0910f85adfec4a2cddfe2297be821841f4dd671 (diff) | |
download | chawan-a0c6f80f76d60bc2bb36942d4162b90e6b5aa2a2.tar.gz |
dom: remove generic JS bindings
Dispatch manually with fromJS instead.
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) |