handlers inside of handlers
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- testing
Research direction
No file or test is named. Start by locating the existing handler parsing and dispatch entry point, then compare its behavior with the proposed nested {hash_{user_a}_{user_b}} syntax. Done would require an agreed design and tests demonstrating nested handlers.
Written by the indexing model from the issue text.
Description
If we could nest handers inside of handlers
{hash_recursive_make:a_make:b}
handler['recursive'] = function(req, optStr, next) {
var opts = optStr.split('_');
for(var i=0; i<opts.length; i++) {
if(opts[i].indexOf('make:') === 0) {
var username = opts[i].replace('make:', '');
return makeUser(username, function(err, userid) {
if(err) next(err);
opts[i] = userid;
return handler['recursive'](req, opts.join('_'), next);
}
}
}
return hashOf(opts);
}
would be
{hash_{user_a}_{user_b}}
hander['hash'] = function(req, optsStr, next) {
return hashOf(optsStr.split('_'));
}
hander['user'] = function(req, username, next) {
makeUser(username, next);
}
Does this seem like something we want to support? If so, I can create a PR to make it happen.
- Dominant language
- JavaScript
- Stars
- 5
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/assert-http
-
Unit tests Open
mapbox/assert-http#12 · 1 assignee ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
mapbox/assert-http#10 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
mapbox/assert-http#1 ·
All issues in mapbox/assert-http
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
web-platform-tests/interop#1455 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
corsairdev/corsair#1764 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100