Skip to content

Commit

Permalink
Clean up usage of "return await"
Browse files Browse the repository at this point in the history
  • Loading branch information
DallasHoff committed Dec 2, 2024
1 parent 6b21ad2 commit ba150c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class SQLocal {
| DestroyMessage
>
): Promise<OutputMessage> => {
return await mutationLock(
return mutationLock(
'shared',
this.bypassMutationLock ||
message.type === 'import' ||
Expand Down Expand Up @@ -185,7 +185,7 @@ export class SQLocal {
break;
}

return await new Promise<OutputMessage>((resolve, reject) => {
return new Promise<OutputMessage>((resolve, reject) => {
this.queriesInProgress.set(queryKey, [resolve, reject]);
});
}
Expand Down Expand Up @@ -328,7 +328,7 @@ export class SQLocal {
query: Transaction['query'];
}) => Promise<Result>
): Promise<Result> => {
return await mutationLock('exclusive', false, this.config, async () => {
return mutationLock('exclusive', false, this.config, async () => {
let tx: Transaction | undefined;
this.bypassMutationLock = true;

Expand Down
4 changes: 2 additions & 2 deletions src/drizzle/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export class SQLocalDrizzle extends SQLocal {
"Drizzle's transaction method cannot isolate transactions from outside queries. It is recommended to use the transaction method of SQLocalDrizzle instead (See https://sqlocal.dallashoffman.com/api/transaction#drizzle)."
);
}
return await this.exec(sql, params, method);
return this.exec(sql, params, method);
};

batchDriver = async (
queries: { sql: string; params: unknown[]; method: Sqlite3Method }[]
): Promise<RawResultData[]> => {
return await this.execBatch(queries);
return this.execBatch(queries);
};
}
4 changes: 2 additions & 2 deletions src/lib/mutation-lock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export async function mutationLock<T>(
mutation: () => Promise<T>
): Promise<T> {
if (!bypass && 'locks' in navigator) {
return await navigator.locks.request(
return navigator.locks.request(
`_sqlocal_mutation_(${config.databasePath})`,
{ mode },
mutation
);
} else {
return await mutation();
return mutation();
}
}

0 comments on commit ba150c7

Please sign in to comment.