Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ const getAuth = () => {
export const auth = new Proxy({} as Auth, {
get(_target, property) {
const authClient = getAuth();
const value = Reflect.get(authClient, property);
return typeof value === 'function' ? value.bind(authClient) : value;
const value: unknown = Reflect.get(authClient, property);
return typeof value === 'function'
? (value as (...args: unknown[]) => unknown).bind(authClient)
: value;
},
has(_target, property) {
return Reflect.has(getAuth(), property);
},
});

Expand Down
12 changes: 8 additions & 4 deletions packages/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ const getQueryClient = () => {
export const queryClient = new Proxy({} as Client, {
get(_target, property) {
const client = getQueryClient();
const value = Reflect.get(client, property);
return typeof value === 'function' ? value.bind(client) : value;
const value: unknown = Reflect.get(client, property);
return typeof value === 'function'
? (value as (...args: unknown[]) => unknown).bind(client)
: value;
},
set(_target, property, value) {
return Reflect.set(getQueryClient(), property, value);
Expand All @@ -55,8 +57,10 @@ const getDb = () => {
export const db = new Proxy({} as Database, {
get(_target, property) {
const database = getDb();
const value = Reflect.get(database, property);
return typeof value === 'function' ? value.bind(database) : value;
const value: unknown = Reflect.get(database, property);
return typeof value === 'function'
? (value as (...args: unknown[]) => unknown).bind(database)
: value;
},
set(_target, property, value) {
return Reflect.set(getDb(), property, value);
Expand Down
Loading