-
Notifications
You must be signed in to change notification settings - Fork 47
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
base: main
Are you sure you want to change the base?
Conversation
added shardSplitThreshold to the car pack index
added shardSplitThreshold
There was a problem hiding this 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 } |
There was a problem hiding this comment.
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}').
...(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 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...(shardSplitThreshold) && { shardSplitThreshold : shardSplitThreshold } | |
...(shardSplitThreshold) && { shardSplitThreshold } |
@@ -20,10 +20,11 @@ export type PackProperties = { | |||
maxChunkSize?: number, | |||
maxChildrenPerNode?: number, | |||
wrapWithDirectory?: boolean, | |||
hasher?: MultihashHasher | |||
hasher?: MultihashHasher, | |||
shardSplitThreshold?: number |
There was a problem hiding this comment.
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
shardSplitThreshold?: number | |
shardSplitThreshold?: number |
This adds support for the shardSplitThreshold option to be passed in to js-ipfs-unixfs