-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
BugError or unexpected behaviorsError or unexpected behaviors
Description
p5.js version
No response
What is your operating system?
None
Web browser and version
No response
Actual Behavior
findByEmailOrUsername() uses arguments.length === 2 to decide whether to use case-insensitive behavior. This is fragile: it can break with default parameters, extra arguments, or different call styles. Modern practice is to use explicit parameter checks.
Location: server/models/user.ts – findByEmailOrUsername() line 291
Expected Behavior
Case-insensitive behavior should be controlled by explicitly checking the options parameter (e.g. options && typeof options === 'object' && options.caseInsensitive) instead of arguments.length.
Steps to reproduce
Steps:
- Open
server/models/user.tsand findfindByEmailOrUsername. - Note the condition
arguments.length === 2 && typeof options === 'object' && options.caseInsensitive. - Consider calling with default args or from a wrapper that passes a third argument; behavior may be inconsistent.
Snippet:
// user.ts - findByEmailOrUsername
if (
arguments.length === 2 &&
typeof options === 'object' &&
options.caseInsensitive
) {
// case-insensitive branch
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugError or unexpected behaviorsError or unexpected behaviors