SSE Session and examples

This commit is contained in:
2026-09-17 07:51:48 +00:00
committed by Kuldeep
parent e96ab6457b
commit 752cda0706
16 changed files with 2306 additions and 4 deletions
+12
View File
@@ -37,3 +37,15 @@ export const isWithinBounds = (value: number, min: number, max: number): boolean
return true;
};
/**
* Converts a non-error to an error
* @param error - The error to convert
* @returns The error
*/
export const normalizeError = (error: unknown): Error => {
// Convert the error to an error if it is not already an error
const errorInstance = error instanceof Error ? error : new Error(`${error}`);
return errorInstance;
};