Skip to content

Commit

Permalink
Migrate to deno v2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc committed Oct 28, 2024
1 parent b959837 commit 0df60ff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
},
"exclude": ["_fresh", "static/sw.js"]
},
"unstable": ["ffi", "fs"]
"unstable": ["ffi"]
}
2 changes: 1 addition & 1 deletion import_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down
5 changes: 5 additions & 0 deletions server/SortableURLSearchParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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][] = [];
Expand All @@ -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,
Expand All @@ -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[] = [];
Expand All @@ -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])}`
Expand All @@ -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();
}
Expand Down

0 comments on commit 0df60ff

Please sign in to comment.