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:
dswbx
2025-09-18 09:58:12 +02:00
parent 07029e3797
commit 6e3060141b
5 changed files with 15 additions and 8 deletions

View File

@@ -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[]) {

View File

@@ -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";