Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Oct 6, 2020
1 parent 3d9ef4d commit c5fd61f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/ipfs-core/src/components/add-all/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const normaliseAddInput = require('ipfs-core-utils/src/files/normalise-input')
const { parseChunkerString } = require('./utils')
const { pipe } = require('it-pipe')
const { withTimeoutOption } = require('../../utils')
const mergeOptions = require('merge-options').bind({ ignoreUndefined: true })

/**
* @typedef {Uint8Array | Blob | string | Iterable<Uint8Array> | Iterable<number> | AsyncIterable<Uint8Array> | ReadableStream<Uint8Array>} FileContent
Expand Down Expand Up @@ -57,16 +58,13 @@ module.exports = ({ block, gcLock, preload, pin, options: constructorOptions })
/**
* @type {AddAll<{}>}
*/
async function * addAll (source, options) {
options = options || {}

const sharding = { shardSplitThreshold: isShardingEnabled ? 1000 : Infinity }
const opts = {
...sharding,
...options,
strategy: 'balanced',
async function * addAll (source, options = {}) {
const opts = mergeOptions({
shardSplitThreshold: isShardingEnabled ? 1000 : Infinity,
strategy: 'balanced'
}, options, {
...parseChunkerString(options.chunker)
}
})

// CID v0 is for multihashes encoded with sha2-256
if (opts.hashAlg && opts.hashAlg !== 'sha2-256' && opts.cidVersion !== 1) {
Expand Down

0 comments on commit c5fd61f

Please sign in to comment.