mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 16:46:00 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user