mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
refactor: improve type handling and config structure
Updated various type definitions to improve flexibility and maintain consistency, including `MaybePromise` and `PartialRec`. Adjusted `App` class and related configurations to properly utilize these changes.
This commit is contained in:
@@ -72,12 +72,12 @@ export class Result<T = unknown> {
|
||||
return this.first().parameters;
|
||||
}
|
||||
|
||||
get data() {
|
||||
get data(): T {
|
||||
if (this.options.single) {
|
||||
return this.first().data?.[0];
|
||||
}
|
||||
|
||||
return this.first().data ?? [];
|
||||
return this.first().data ?? ([] as T);
|
||||
}
|
||||
|
||||
async execute(qb: Compilable | Compilable[]) {
|
||||
|
||||
@@ -4,5 +4,6 @@ export * from "./mutation/Mutator";
|
||||
export * from "./query/Repository";
|
||||
export * from "./query/WhereBuilder";
|
||||
export * from "./query/WithBuilder";
|
||||
export * from "./Result";
|
||||
export * from "./query/RepositoryResult";
|
||||
export * from "./mutation/MutatorResult";
|
||||
|
||||
Reference in New Issue
Block a user