Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add the shardSplitThreshold option to this library #92

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

obo20
Copy link

@obo20 obo20 commented Sep 17, 2021

This adds support for the shardSplitThreshold option to be passed in to js-ipfs-unixfs

Copy link
Collaborator

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @obo20
Left some inline suggestions to fix the linting job

@@ -38,7 +39,8 @@ export async function pack ({ input, blockstore: userBlockstore, hasher, maxChun
hasher: hasher || unixfsImporterOptionsDefault.hasher,
maxChunkSize: maxChunkSize || unixfsImporterOptionsDefault.maxChunkSize,
maxChildrenPerNode: maxChildrenPerNode || unixfsImporterOptionsDefault.maxChildrenPerNode,
wrapWithDirectory: wrapWithDirectory === false ? false : unixfsImporterOptionsDefault.wrapWithDirectory
wrapWithDirectory: wrapWithDirectory === false ? false : unixfsImporterOptionsDefault.wrapWithDirectory,
...(shardSplitThreshold) && { shardSplitThreshold : shardSplitThreshold }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tslint job is failing here with:

src/pack/index.ts:24:31
ERROR: 43:37  object-literal-shorthand  Expected property shorthand in object literal ('{shardSplitThreshold}').
Suggested change
...(shardSplitThreshold) && { shardSplitThreshold : shardSplitThreshold }
...(shardSplitThreshold) && { shardSplitThreshold }

@@ -37,7 +37,8 @@ export async function packToStream ({ input, writable, blockstore: userBlockstor
hasher: hasher || unixfsImporterOptionsDefault.hasher,
maxChunkSize: maxChunkSize || unixfsImporterOptionsDefault.maxChunkSize,
maxChildrenPerNode: maxChildrenPerNode || unixfsImporterOptionsDefault.maxChildrenPerNode,
wrapWithDirectory: wrapWithDirectory === false ? false : unixfsImporterOptionsDefault.wrapWithDirectory
wrapWithDirectory: wrapWithDirectory === false ? false : unixfsImporterOptionsDefault.wrapWithDirectory,
...(shardSplitThreshold) && { shardSplitThreshold : shardSplitThreshold }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
...(shardSplitThreshold) && { shardSplitThreshold : shardSplitThreshold }
...(shardSplitThreshold) && { shardSplitThreshold }

@@ -20,10 +20,11 @@ export type PackProperties = {
maxChunkSize?: number,
maxChildrenPerNode?: number,
wrapWithDirectory?: boolean,
hasher?: MultihashHasher
hasher?: MultihashHasher,
shardSplitThreshold?: number
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linter failing here with:

src/pack/index.ts:24:31
ERROR: 24:31  no-trailing-whitespace    trailing whitespace
Suggested change
shardSplitThreshold?: number
shardSplitThreshold?: number

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants