Skip to content

Commit

Permalink
chore(spelling): Fix some spelling mistakes in vite/middleware (redwo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jun 8, 2024
1 parent ed75ed8 commit 868b6b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/vite/src/middleware/MiddlewareRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AuthStateJar {

/**
* Always returns the server auth state, even if its set to null,
* it'll fall back to the initial state (created when mwReq is initialised)
* it'll fall back to the initial state (created when mwReq is initialized)
*/
get() {
return this._data || this._initialState
Expand Down
12 changes: 7 additions & 5 deletions packages/vite/src/middleware/MiddlewareResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ export class MiddlewareShortCircuit extends Error {
mwResponse: MiddlewareResponse

constructor(body?: BodyInit | null, responseInit?: ResponseInit) {
super('Short cirtcuit. Skipping all middleware, and returning early')
super('Short circuit. Skipping all middleware, and returning early')
this.name = 'MiddlewareShortCircuit'
this.mwResponse = new MiddlewareResponse(body, responseInit)
}
}

/**
* This is actually a Response builder class
* After setting all the required proeprties, we can call `build` to get a Web API Response object
* After setting all the required properties, we can call `build` to get a Web
* API Response object
*/
export class MiddlewareResponse {
cookies = new CookieJar()
Expand Down Expand Up @@ -66,16 +67,17 @@ export class MiddlewareResponse {

/**
* Skip the current middleware and move to the next one.
* Careful: It creates a new Response, so any middleware that modifies the response before the current one will be lost.
* Careful: It creates a new Response, so any middleware that modifies the
* response before the current one will be lost.
* @returns MiddlewareResponse
*/
static next = () => {
return new MiddlewareResponse()
}

/**
*
* Return a MiddlewareResponse object that will redirect the client to the specified location
* Return a MiddlewareResponse object that will redirect the client to the
* specified location
*
* @returns MiddlewareResponse
*/
Expand Down

0 comments on commit 868b6b0

Please sign in to comment.