mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-18 17:04:41 +08:00
Migrate to deno v2.x
This commit is contained in:
8
db.ts
8
db.ts
@@ -1081,19 +1081,19 @@ export class EhDb {
|
||||
}
|
||||
async flock() {
|
||||
if (!this.#file) return;
|
||||
await eval(`Deno.flock(${this.#file.rid}, true);`);
|
||||
await this.#file.lock();
|
||||
}
|
||||
dblock() {
|
||||
if (!this.#dblock) return;
|
||||
eval(`Deno.flockSync(${this.#dblock.rid}, true);`);
|
||||
this.#dblock.lockSync();
|
||||
}
|
||||
async funlock() {
|
||||
if (!this.#file) return;
|
||||
await eval(`Deno.funlock(${this.#file.rid});`);
|
||||
await this.#file.unlock();
|
||||
}
|
||||
dbunlock() {
|
||||
if (!this.#dblock) return;
|
||||
eval(`Deno.funlockSync(${this.#dblock.rid});`);
|
||||
this.#dblock.unlockSync();
|
||||
}
|
||||
get_client_config(uid: number | bigint, client: string, name: string) {
|
||||
const d = this.db.queryEntries<ClientConfig>(
|
||||
|
||||
@@ -35,5 +35,5 @@
|
||||
},
|
||||
"exclude": ["_fresh", "static/sw.js"]
|
||||
},
|
||||
"unstable": ["ffi", "fs"]
|
||||
"unstable": ["ffi"]
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"@std/path": "jsr:/@std/[email protected]",
|
||||
"@std/semver": "jsr:/@std/[email protected]",
|
||||
"deno_dom/": "jsr:/@b-fuze/[email protected]/",
|
||||
"sqlite/": "https://deno.land/x/sqlite@v3.8/",
|
||||
"sqlite/": "https://deno.land/x/sqlite@v3.9.1/",
|
||||
"zipjs/": "https://deno.land/x/[email protected]/",
|
||||
"$fresh/": "https://deno.land/x/[email protected]/",
|
||||
"preact": "https://esm.sh/[email protected]",
|
||||
|
||||
@@ -7,6 +7,7 @@ export class SortableURLSearchParams extends URLSearchParams {
|
||||
super(init);
|
||||
this.excludes = excludes;
|
||||
}
|
||||
// @ts-ignore Fuck
|
||||
entries(): IterableIterator<[string, string]> {
|
||||
this.sort();
|
||||
const a: [string, string][] = [];
|
||||
@@ -15,6 +16,7 @@ export class SortableURLSearchParams extends URLSearchParams {
|
||||
}
|
||||
return a.values();
|
||||
}
|
||||
// @ts-ignore Fuck
|
||||
forEach(
|
||||
callbackfn: (value: string, key: string, parent: this) => void,
|
||||
thisArg?: unknown,
|
||||
@@ -23,6 +25,7 @@ export class SortableURLSearchParams extends URLSearchParams {
|
||||
callbackfn.apply(thisArg, [v, k, this]);
|
||||
}
|
||||
}
|
||||
// @ts-ignore Fuck
|
||||
keys(): IterableIterator<string> {
|
||||
this.sort();
|
||||
const a: string[] = [];
|
||||
@@ -31,6 +34,7 @@ export class SortableURLSearchParams extends URLSearchParams {
|
||||
}
|
||||
return a.values();
|
||||
}
|
||||
// @ts-ignore Fuck
|
||||
toString(): string {
|
||||
return Array.from(this.entries()).map((v) =>
|
||||
`${encodeURIComponent(v[0])}=${encodeURIComponent(v[1])}`
|
||||
@@ -40,6 +44,7 @@ export class SortableURLSearchParams extends URLSearchParams {
|
||||
const s = this.toString();
|
||||
return s.length ? `?${s}` : "";
|
||||
}
|
||||
// @ts-ignore Fuck
|
||||
values(): IterableIterator<string> {
|
||||
return Array.from(this.entries()).map((v) => v[1]).values();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user