Skip to content

Rename internal errorOccured -> errorOccurred in make-middleware#1393

Open
SAY-5 wants to merge 1 commit intoexpressjs:mainfrom
SAY-5:fix-error-occured-typo
Open

Rename internal errorOccured -> errorOccurred in make-middleware#1393
SAY-5 wants to merge 1 commit intoexpressjs:mainfrom
SAY-5:fix-error-occured-typo

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 15, 2026

lib/make-middleware.js keeps a one-shot 'has the upload errored?' flag named errorOccured (5 references). The variable is private to the closure that builds the middleware so the rename is invisible to consumers, but it removes a spelling mistake from a high-traffic project.

35:    var errorOccured = false
73:      if (readFinished && pendingWrites.isZero() && !errorOccured) done()
77:      if (errorOccured) return
78:      errorOccured = true
184:        if (errorOccured) {

Verification:

  • npm test — all 72 mocha tests pass
  • npm run lint (standard) — clean

Source verified against current main.

The middleware kept a one-shot 'has the upload errored?' flag named
errorOccured (5 references in lib/make-middleware.js). The variable is
private to the closure, so the rename is invisible to consumers but
removes a small spelling mistake from a 12k-star project. All 72
mocha tests pass and 'standard' lint stays clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant