Bump std to 0.194.0

Remove ua-parser-js
This commit is contained in:
2023-07-17 16:32:43 +08:00
parent 0f4118bdbb
commit 46acf2980a
2 changed files with 3 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"imports": {
"std/": "https://deno.land/[email protected]2.0/",
"std/": "https://deno.land/[email protected]4.0/",
"deno_dom/": "https://deno.land/x/[email protected]/",
"sqlite/": "https://deno.land/x/[email protected]/",
"zipjs/": "https://deno.land/x/[email protected]/",
@@ -21,7 +21,6 @@
"meilisearch": "https://esm.sh/[email protected]",
"lodash/": "https://esm.sh/[email protected]/",
"mime": "https://esm.sh/[email protected]",
"ua-parser-js": "https://esm.sh/[email protected]",
"pbkdf2-hmac": "https://esm.sh/[email protected]",
"pbkdf2-hmac/": "https://esm.sh/[email protected]/",
"randomstring": "https://esm.sh/[email protected]",

View File

@@ -3,7 +3,7 @@ import { Handlers, PageProps } from "$fresh/server.ts";
import GlobalContext from "../components/GlobalContext.tsx";
import Container from "../islands/Container.tsx";
import { get_i18nmap, i18n_handle_request } from "../server/i18ns.ts";
import parse_ua from "ua-parser-js";
import { UserAgent } from "std/http/user_agent.ts";
type Props = {
lang: string;
@@ -25,7 +25,7 @@ export const handler: Handlers<Props> = {
export default function Index({ data }: PageProps<Props>) {
const i18n = get_i18nmap(data.lang);
const ua = parse_ua(data.userAgent || "");
const ua = new UserAgent(data.userAgent || "");
const is_windows_chrome = ua.browser.name === "Chrome" &&
ua.os.name === "Windows";
return (