Skip to content

Commit

Permalink
chore: pr-nit fix
Browse files Browse the repository at this point in the history
Co-authored-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
  • Loading branch information
SgtPooki and whizzzkid authored Jul 6, 2023
1 parent 9f68f1f commit 1e3fe8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/ipfs-unixfs-importer/src/chunker/rabin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export const rabin = (options: RabinOptions = {}): Chunker => {

const isInvalidChunkSizes = [min, avg, max].some((size) => size == null || isNaN(size))

if (options.avgChunkSize != null && isInvalidChunkSizes) {
throw errcode(new Error('please specify a valid average chunk size number'), 'ERR_INVALID_AVG_CHUNK_SIZE')
}

if (isInvalidChunkSizes) {
if (options.avgChunkSize != null) {
throw errcode(new Error('please specify a valid average chunk size number'), 'ERR_INVALID_AVG_CHUNK_SIZE')
}

throw errcode(new Error('please specify valid numbers for (min|max|avg)ChunkSize'), 'ERR_INVALID_CHUNK_SIZE')
}

Expand Down

0 comments on commit 1e3fe8a

Please sign in to comment.