deno.land / x / abc@v1.3.3 / util.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { extname } from "./vendor/https/deno.land/std/path/mod.ts";import { MIME } from "./constants.ts";import { NotFoundException } from "./http_exception.ts";
/** Returns the content-type based on the extension of a path. */export function contentType(filepath: string): string | undefined { return MIME.DB[extname(filepath)];}
export function hasTrailingSlash(str: string): boolean { if (str.length > 1 && str[str.length - 1] === "/") { return true; }
return false;}
export function NotFoundHandler(): never { throw new NotFoundException();}
abc

Version Info

Tagged at
2 years ago