expressjs / expressjs/multer

Is there an way to accept only the fields that match a certain pattern?

Open
#1,034 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
1.1k
Avg merge
8d 2h
Merged PRs (30d)
21

Description

I am thinking something like this:
Suppose I have some Image fields like v1,v2,v3... Now the number of such fields cannot be determined in advance so it would be nice to have the multer.fields([]) funciton to also work like this:-
multer.fields([{name: /^v\d+$/, maxCount: 1}])

Contributor guide

Open the contributing guide

Research direction

Start with the existing multer.fields entry point and its field-name validation behavior. Check how unknown field names and maxCount are currently handled, then determine the expected behavior for a regular-expression field name and add coverage for the requested pattern-matching case. Done means the API accepts fields matching the pattern while preserving existing field limits and behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.