This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: set the FileResultStreamConverter explicitly
The `SendFilesStream` used to run the `FileResultStreamConverter` automatically. With making it an option to use a converter, `SendFilesStream` can be used outside of the Files API, e.g. for the DAG API. Closes #696.
- Loading branch information
Showing
8 changed files
with
57 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
'use strict' | ||
|
||
const SendFilesStream = require('../utils/send-files-stream') | ||
const FileResultStreamConverter = require('../utils/file-result-stream-converter') | ||
const toPull = require('stream-to-pull-stream') | ||
|
||
module.exports = (send) => (options) => toPull(SendFilesStream(send, 'add')(options)) | ||
module.exports = (send) => { | ||
return (options) => { | ||
options = options || {} | ||
options.converter = FileResultStreamConverter | ||
return toPull(SendFilesStream(send, 'add')(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
'use strict' | ||
|
||
const SendFilesStream = require('../utils/send-files-stream') | ||
const FileResultStreamConverter = require('../utils/file-result-stream-converter') | ||
|
||
module.exports = (send) => SendFilesStream(send, 'add') | ||
module.exports = (send) => { | ||
return (options) => { | ||
options = options || {} | ||
options.converter = FileResultStreamConverter | ||
return SendFilesStream(send, 'add')(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 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
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