This repository has been archived by the owner on Apr 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: This module used to export a class that extended EventEmitter, now it exports a function that returns an async iterable. I also updated the deps to use the latest http api, though it's removed the ability to add whole paths at once, along with some special logic to handle symlinks. The `Dicer` module that this module depends on will still emit events for when it encounters symlinks so I left the handlers in though am unsure if we actually use them.
- Loading branch information
1 parent
edc2f72
commit cddea6c
Showing
8 changed files
with
305 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
'use strict' | ||
|
||
const content = require('@hapi/content') | ||
const Parser = require('./parser') | ||
const parser = require('./parser') | ||
|
||
module.exports = { | ||
Parser, | ||
/** | ||
* Request Parser | ||
* | ||
* @param {Object} req - Request | ||
* @returns {Parser} | ||
*/ | ||
reqParser: (req) => { | ||
const boundary = content.type(req.headers['content-type']).boundary | ||
const parser = new Parser({ boundary: boundary }) | ||
req.pipe(parser) | ||
return parser | ||
} | ||
/** | ||
* Request Parser | ||
* | ||
* @param {Object} req - Request | ||
* @param {Object} options - Options passed to stream constructors | ||
* @returns {Object} an async iterable | ||
*/ | ||
module.exports = (req, options = {}) => { | ||
options.boundary = content.type(req.headers['content-type']).boundary | ||
|
||
return parser(req.payload || req, options) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.