All files / src/middleware guard.ts

80% Statements 4/5
71.42% Branches 5/7
100% Functions 2/2
75% Lines 3/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11444x 212x             212x    
export default function guard<T>(property: T | undefined): T {
  Iif (property == null) {
    throw new Error(
      `You are trying to access a middleware property on the response object that is undefined at run time. 
            Are you sure the middleware is actually running before the handler for this route?`,
    );
  }
 
  return property;
}