Skip to content

Importer with empty source should fail with wrap with directory? #159

Open
@vasco-santos

Description

@vasco-santos

When using a wrapWithDirectory: false, nothing will be yielded from the unixfs importer when providing an empty import candidate. However, when wrapWithDirectory: true the empty directory is returned.

Is this the expected behaviour?

import normalizeAddInput from 'ipfs-core-utils/src/files/normalise-input/index.js'
import { importer } from 'ipfs-unixfs-importer'

const input = []

const rootEntry = await last(pipe(
    normalizeAddInput(input),
    (source: any) => importer(source, blockstore, {
      cidVersion: 1,
      chunker: 'fixed',
      maxChunkSize: 262144,
      hasher: sha256,
      rawLeaves: true,
      wrapWithDirectory: true
    })
  ))

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upexp/noviceSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issuekind/discussionTopical discussion; usually not changes to codebasetopic/docsDocumentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions