From c103ef08b8515f466969c27d93916c5bb64df6ea Mon Sep 17 00:00:00 2001 From: lifegpc Date: Thu, 22 Jun 2023 07:25:26 +0800 Subject: [PATCH] Update deps --- db.ts | 22 +++++++++++----------- import_map.json | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/db.ts b/db.ts index f3e2f67..9d31473 100644 --- a/db.ts +++ b/db.ts @@ -1,5 +1,5 @@ import { DB } from "sqlite/mod.ts"; -import { SemVer } from "std/semver/mod.ts"; +import { compare as compare_ver, parse as parse_ver } from "std/semver/mod.ts"; import { unescape } from "std/html/mod.ts"; import { join, resolve } from "std/path/mod.ts"; import { SqliteError } from "sqlite/mod.ts"; @@ -162,7 +162,7 @@ export class EhDb { #lock_file: string | undefined; #dblock_file: string | undefined; #_tags: Map | undefined; - readonly version = new SemVer("1.0.0-7"); + readonly version = parse_ver("1.0.0-7"); constructor(base_path: string) { const db_path = join(base_path, "data.db"); sure_dir_sync(base_path); @@ -203,13 +203,13 @@ export class EhDb { this.#updateExistsTable(); const v = this.#read_version(); if (!v) return false; - if (v.compare(this.version) === -1) { + if (compare_ver(v, this.version) === -1) { let need_optimize = false; - if (v.compare("1.0.0-1") === -1) { + if (compare_ver(v, parse_ver("1.0.0-1")) === -1) { this.db.execute("ALTER TABLE tag ADD translated TEXT;"); this.db.execute("ALTER TABLE tag ADD intro TEXT;"); } - if (v.compare("1.0.0-2") === -1) { + if (compare_ver(v, parse_ver("1.0.0-2")) === -1) { this.convert_file( this.db.queryEntries("SELECT * FROM file;"), ).forEach((f) => { @@ -217,10 +217,10 @@ export class EhDb { this.add_file(f, false); }); } - if (v.compare("1.0.0-3") === -1) { + if (compare_ver(v, parse_ver("1.0.0-3")) === -1) { this.db.execute("ALTER TABLE task ADD details TEXT;"); } - if (v.compare("1.0.0-4") === -1) { + if (compare_ver(v, parse_ver("1.0.0-4")) === -1) { this.db.execute("ALTER TABLE pmeta RENAME TO pmeta_origin;"); this.db.execute(PMETA_TABLE); this.db.execute( @@ -229,10 +229,10 @@ export class EhDb { this.db.execute("DROP TABLE pmeta_origin;"); need_optimize = true; } - if (v.compare("1.0.0-5") === -1) { + if (compare_ver(v, parse_ver("1.0.0-5")) === -1) { this.db.execute("ALTER TABLE task DROP pn;"); } - if (v.compare("1.0.0-6") === -1) { + if (compare_ver(v, parse_ver("1.0.0-6")) === -1) { let offset = 0; let tasks = this.convert_gmeta( this.db.queryEntries( @@ -255,7 +255,7 @@ export class EhDb { ); } } - if (v.compare("1.0.0-7") === -1) { + if (compare_ver(v, parse_ver("1.0.0-7")) === -1) { this.db.execute("ALTER TABLE file RENAME TO file_origin;"); this.db.execute(FILE_TABLE); let offset = 0; @@ -325,7 +325,7 @@ export class EhDb { ["eh"], ); for (const i of cur) { - return new SemVer(i[0]); + return parse_ver(i[0]); } return null; } diff --git a/import_map.json b/import_map.json index 65aaf9e..6b15564 100644 --- a/import_map.json +++ b/import_map.json @@ -1,9 +1,9 @@ { "imports": { - "std/": "https://deno.land/std@0.191.0/", + "std/": "https://deno.land/std@0.192.0/", "deno_dom/": "https://deno.land/x/deno_dom@v0.1.38/", "sqlite/": "https://deno.land/x/sqlite@v3.7.2/", - "zipjs/": "https://deno.land/x/zipjs@v2.7.14/", + "zipjs/": "https://deno.land/x/zipjs@v2.7.16/", "$fresh/": "https://deno.land/x/fresh@1.2.0/", "preact": "https://esm.sh/preact@10.15.1", "preact/": "https://esm.sh/preact@10.15.1/", @@ -16,7 +16,7 @@ "preact-material-components/": "https://esm.sh/preact-material-components@1.6.1/", "accept-language-parser/": "https://esm.sh/accept-language-parser@1.5.0/", "sortable": "https://esm.sh/gh/SortableJS/Sortable@1.15.0/Sortable.min.js", - "esbuild/": "https://deno.land/x/esbuild@v0.18.0/", + "esbuild/": "https://deno.land/x/esbuild@v0.18.6/", "lifegpc-md5": "https://esm.sh/lifegpc-md5@1.0.3", "meilisearch": "https://esm.sh/meilisearch@0.33.0", "lodash/": "https://esm.sh/lodash@4.17.21/",