@@ -12,19 +12,25 @@ interface ValidationResult<T> {
1212
1313/**
1414 * Validates user data - basic security checks
15+ *
16+ * @param user
1517 */
1618export function validateUser ( user : AffectedUser ) : ValidationResult < AffectedUser > {
1719 const errors : string [ ] = [ ] ;
1820
1921 if ( ! user || ! Sanitizer . isObject ( user ) ) {
2022 errors . push ( 'User must be an object' ) ;
21- return { isValid : false , errors } ;
23+
24+ return { isValid : false ,
25+ errors } ;
2226 }
2327
2428 // Validate required ID
2529 if ( ! user . id || typeof user . id !== 'string' || user . id . trim ( ) === '' ) {
2630 errors . push ( 'User ID is required and must be a non-empty string' ) ;
27- return { isValid : false , errors } ;
31+
32+ return { isValid : false ,
33+ errors } ;
2834 }
2935
3036 const validatedUser : AffectedUser = {
@@ -53,13 +59,17 @@ export function validateUser(user: AffectedUser): ValidationResult<AffectedUser>
5359
5460/**
5561 * Validates context data - basic security checks
62+ *
63+ * @param context
5664 */
5765export function validateContext ( context : EventContext ) : ValidationResult < EventContext > {
5866 const errors : string [ ] = [ ] ;
5967
6068 if ( ! context || ! Sanitizer . isObject ( context ) ) {
6169 errors . push ( 'Context must be an object' ) ;
62- return { isValid : false , errors } ;
70+
71+ return { isValid : false ,
72+ errors } ;
6373 }
6474
6575 return {
@@ -71,6 +81,9 @@ export function validateContext(context: EventContext): ValidationResult<EventCo
7181
7282/**
7383 * Logs validation errors
84+ *
85+ * @param prefix
86+ * @param errors
7487 */
7588export function logValidationErrors ( prefix : string , errors : string [ ] ) : void {
7689 errors . forEach ( ( error ) => {
0 commit comments