add validation logs and improve data validation handling (#157)

Added warning logs for invalid data during mutator validation, refined field validation logic to handle undefined values, and adjusted event validation comments for clarity. Minor improvements include exporting events from core and handling optional chaining in entity field validation.
This commit is contained in:
dswbx
2025-04-22 15:44:34 +02:00
committed by GitHub
parent e246396225
commit 5763a6e150
5 changed files with 22 additions and 6 deletions
+4
View File
@@ -14,6 +14,10 @@ export abstract class Event<Params = any, Returning = void> {
params: Params;
returned: boolean = false;
/**
* Shallow validation of the event return
* It'll be deeply validated on the place where it is called
*/
validate(value: Returning): Event<Params, Returning> | void {
throw new EventReturnedWithoutValidation(this as any, value);
}
+1
View File
@@ -27,6 +27,7 @@ export {
export { Registry, type Constructor } from "./registry/Registry";
export * from "./console";
export * from "./events";
// compatibility
export type Middleware = MiddlewareHandler<any, any, any>;