Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

refactor: fetch add #1063

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: remove unused code
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
Alan Shaw committed Aug 3, 2019
commit c21333640a25d4e9401c86c7d39116d11b4360e3
4 changes: 2 additions & 2 deletions src/add/form-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const FormData = require('form-data')
const { Buffer } = require('buffer')
const toStream = require('it-to-stream')
const normaliseInput = require('./normalise-input')
const toStream = require('../lib/iterable-to-readable-stream')

exports.toFormData = async (input) => {
const files = normaliseInput(input)
Expand All @@ -19,7 +19,7 @@ exports.toFormData = async (input) => {
// a Content-Length header that is only the sum of the size of the
// header/footer when knownLength option (below) is null.
Object.assign(
toStream(file.content),
toStream.readable(file.content),
{ path: file.path || `file-${i}` }
),
{
Expand Down
4 changes: 1 addition & 3 deletions src/files-mfs/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const promisify = require('promisify-es6')
const concatStream = require('concat-stream')
const once = require('once')
const FileResultStreamConverter = require('../utils/file-result-stream-converter')
const SendFilesStream = require('../utils/send-files-stream')

module.exports = (send) => {
Expand All @@ -29,8 +28,7 @@ module.exports = (send) => {

const options = {
args: pathDst,
qs: opts,
converter: FileResultStreamConverter
qs: opts
}

const stream = sendFilesStream({ qs: options })
Expand Down
101 changes: 0 additions & 101 deletions src/lib/iterable-to-readable-stream.js

This file was deleted.

44 changes: 0 additions & 44 deletions src/utils/file-result-stream-converter.js

This file was deleted.